No.58 · Controls
Punch Check
Checkboxes on a ticket: checking one punches it — the paper squashes, a clean hole opens and the chad drops out and tumbles away.
The prompt
The design brief behind this component — reuse it to regenerate, remix, or explain it.
Build checkboxes that are punched like a paper ticket, with a real (visually hidden) <input type="checkbox"> inside each row's <label>. The ticket is a cream card (12px radius, soft shadow) with a dashed-perforation stub on the left carrying a vertical mono code, an Instrument Serif title, and rows separated by hairlines: an option name, a small mono price hint, and at the right a 26px punch spot drawn as a dashed circle. Checking: the spot squashes (scale 0.86 → 1, 220ms) as if under the punch, the dashed guide fades, a dark hole with an inset shadow and a light lower lip pops open (scale 0 → 1 on a springy curve) — the page colour shows through it — and a paper chad (a small disc in the ticket colour) drops out: translate down 150px with its own sideways drift, spinning 280–540deg and flattening (scaleY → 0.35, as if tumbling edge-on) while it fades, over 900ms with a gravity-like ease. Drift and spin come from a seed per row, so no two fall alike. Unchecking flies the chad back up into the hole (420ms, ease-out) and the hole closes under it. The chad element is re-keyed per change so its animation replays. Focus shows a ring round the spot.
Notes
- Interaction
- Click or tap a row, or press Space when it's focused, to punch it; again to put the chad back.
- Motion
- Squash 220ms; hole 120ms springy; chad fall 900ms with drift and spin; return 420ms.
- Accessibility
- Native checkboxes inside a fieldset with a legend (the ticket title); every row is its label. Decorative parts are aria-hidden. Reduced motion shows the hole without the falling chad.
- Responsive
- The ticket is min(100%, 30rem); labels wrap beside the fixed punch spot.
- On touch
- Tap anywhere on a row to punch it.