Skip to content

No.97 · Controls

Bracket Checkbox

A square checkbox framed by offset crop-mark brackets; checking floods the box and draws a hand-made tick.

The prompt

Copy this text

Automatic copying is unavailable. Copy the selected text using your device’s copy command.

Written for the variant you picked above: Light surface

Build a native checkbox with an editorial, print-inspired look. The box is a 22px square with a 1.5px ink border, square corners and a transparent fill. Two 8px corner brackets sit 5px outside the box — one at the top-left, one at the bottom-right — like crop marks framing it (drawn with ::before/::after on a wrapper). When checked, the box floods solid ink instantly and a hand-drawn tick draws itself on top: a single cubic-bezier path with a slightly wobbly, human stroke (1.7px, round caps, paper-coloured), animated with stroke-dashoffset over 480ms using cubic-bezier(0.65,0,0.35,1) after a 70ms beat, so the fill lands first and the pen follows. Unchecking reverses the draw. Keep the real <input type="checkbox"> (appearance: none) so forms, keyboard and screen readers work untouched. Focus-visible shows a 2px outline 3px out. An invalid state turns the box and both brackets a muted brick red and shows an alert message below with a small diamond bullet. The row is at least 44px tall. Provide light and dark surfaces. On fine pointers, the brackets open 2px outward on hover. Selected variant — Light surface (light): Apply the light surface theme. Where the brief above gives no colour values for it, choose a restrained light surface palette with text at 4.5:1 contrast or better. Keep the geometry, states and motion described above unchanged. This selection takes precedence over references to other themes or options in the general brief. Implement this selected appearance; do not add a variant picker or alternative appearances unless requested. Implementation requirements: Use React and TypeScript. Keep the component self-contained, with uniquely scoped CSS and no animation libraries. Include required imports, styles and font setup in the result. Interaction: Click or Space toggles. The tick draws in on check and un-draws on uncheck; brackets open 2px on hover (fine pointers only). Motion: Tick: stroke-dashoffset 1 → 0 over 480ms, cubic-bezier(0.65,0,0.35,1), 70ms delay. Brackets: 220ms translate. Accessibility: Native checkbox wrapped in a <label>, so the whole row is clickable. aria-invalid and aria-describedby wire up the error message, which is announced with role="alert". Decorative tick is aria-hidden. Responsive behavior: Fluid row; text wraps beside the fixed 22px box. 44px minimum row height for touch. Touch: Hover addition is gated to fine pointers; everything else is tap-driven. Preserve keyboard access, visible focus and reduced-motion behavior. Keep fictional demo data and simulated service calls in a separate usage example; expose callbacks for real actions and recover from rejected requests. Keep usage-example links inside the demo: use local buttons or prevent navigation. Demonstration links must not navigate to Vitrine routes or open other pages; preserve real URL support in the reusable component itself. Verify the result at narrow and wide viewport sizes, with keyboard input and reduced motion enabled.

Notes

Interaction
Click or Space toggles. The tick draws in on check and un-draws on uncheck; brackets open 2px on hover (fine pointers only).
Motion
Tick: stroke-dashoffset 1 → 0 over 480ms, cubic-bezier(0.65,0,0.35,1), 70ms delay. Brackets: 220ms translate.
Accessibility
Native checkbox wrapped in a <label>, so the whole row is clickable. aria-invalid and aria-describedby wire up the error message, which is announced with role="alert". Decorative tick is aria-hidden.
Responsive
Fluid row; text wraps beside the fixed 22px box. 44px minimum row height for touch.
On touch
Hover addition is gated to fine pointers; everything else is tap-driven.