Forms & inputs / Checkboxes & radios
Square Consent Checkbox
Empty square outlined in light grey beside lowercase consent sentence with underlined privacy link and asterisk.
Rebuilt from teenage.engineering/newsletter in the Embossed Lab Monochrome style.
npx shadcn@latest add https://justyoink.it/r/embossed-lab-monochrome/blocks/square-consent-checkbox.json
Looks exactly like teenage.engineering: brings its fonts and colours, namespaced so your own theme stays untouched.
npx shadcn@latest add https://justyoink.it/r/embossed-lab-monochrome/mine/square-consent-checkbox.json
Restyled to your project: uses your shadcn colours, fonts and radius, so it matches the rest of your app. Layout, type sizes and motion stay as designed.
Usage
Props: beforeLink, linkText, linkHref, required, defaultChecked, onChange(checked). The checkbox is a native input styled as a light grey square that shows a tick when checked; the link is always underlined.
components/square-consent-checkbox.tsx
import { useState, useId } from "react"; export default function SquareConsentCheckbox({ beforeLink = "yes, please send me occasional updates and agree to the", linkText = "terms of contact", linkHref = "#", required = true, defaultChecked = false, onChange, }: { beforeLink?: string; linkText?: string; linkHref?: string; required?: boolean; defaultChecked?: boolean; onChange?: (checked: boolean) => void; }) { const [checked, setChecked] = useState(defaultChecked); const id = useId(); return ( <div className="flex items-center gap-4 bg-canvas-0 font-sans"> <span className="relative inline-flex h-[30px] w-[30px] shrink-0"> <input id={id} type="checkbox" checked={checked} required={required} onChange={(e) => { setChecked(e.target.checked); onChange?.(e.target.checked); }} className="peer absolute inset-0 z-10 m-0 h-full w-full cursor-pointer appearance-none border border-surface-muted bg-white focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ink" /> <svg viewBox="0 0 24 24" aria-hidden="true" className="pointer-events-none absolute inset-1 z-20 h-[22px] w-[22px] scale-75 text-ink opacity-0 transition-all duration-tile-hover ease-tile-hover peer-checked:scale-100 peer-checked:opacity-100" > <path d="M4 12.5l5 5L20 6.5" fill="none" stroke="currentColor" strokeWidth="1.75" strokeLinecap="square" /> </svg> </span> <label htmlFor={id} className="cursor-pointer text-body-lg font-light text-ink"> {beforeLink}{" "} <a href={linkHref} className="underline underline-offset-2 focus-visible:outline focus-visible:outline-2 focus-visible:outline-ink" > {linkText} </a> {required && <span aria-hidden="true"> *</span>} </label> </div> ); }import { useState, useId } from "react"; export default function SquareConsentCheckbox({ beforeLink = "yes, please send me occasional updates and agree to the", linkText = "terms of contact", linkHref = "#", required = true, defaultChecked = false, onChange, }: { beforeLink?: string; linkText?: string; linkHref?: string; required?: boolean; defaultChecked?: boolean; onChange?: (checked: boolean) => void; }) { const [checked, setChecked] = useState(defaultChecked); const id = useId(); return ( <div className="flex items-center gap-4 bg-canvas-0 font-mono"> <span className="relative inline-flex h-[30px] w-[30px] shrink-0"> <input id={id} type="checkbox" checked={checked} required={required} onChange={(e) => { setChecked(e.target.checked); onChange?.(e.target.checked); }} className="peer absolute inset-0 z-10 m-0 h-full w-full cursor-pointer appearance-none border border-foreground bg-foreground focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-foreground" /> <svg viewBox="0 0 24 24" aria-hidden="true" className="pointer-events-none absolute inset-1 z-20 h-[22px] w-[22px] scale-75 text-foreground opacity-0 transition-all duration-embossed-tile-hover ease-embossed-tile-hover peer-checked:scale-100 peer-checked:opacity-100" > <path d="M4 12.5l5 5L20 6.5" fill="none" stroke="currentColor" strokeWidth="1.75" strokeLinecap="square" /> </svg> </span> <label htmlFor={id} className="cursor-pointer text-embossed-body-lg font-light text-foreground"> {beforeLink}{" "} <a href={linkHref} className="underline underline-offset-2 focus-visible:outline focus-visible:outline-2 focus-visible:outline-foreground" > {linkText} </a> {required && <span aria-hidden="true"> *</span>} </label> </div> ); }
Quality checks
Automated, in a real browser · today- Accessible: passedNo serious accessibility problems (axe-core): readable contrast, labelled buttons and images.
- Responsive: passedRenders at phone (390px), tablet (768px) and desktop width without sideways scrolling.
- Dark mode: passedStill readable when installed in your theme and switched to dark mode.
- Themeable: passedUses design tokens rather than hard-coded colours, so it follows your theme cleanly.
- Animates cleanly: doesn't applyDoesn't animate, so there's nothing to check.