No.93 · 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
Written for the variant you picked above: Night
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. Selected variant — Night (night): Apply the night theme. Where the brief above gives no colour values for it, choose a restrained night 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 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 behavior: The ticket is min(100%, 30rem); labels wrap beside the fixed punch spot. Touch: Tap anywhere on a row to punch it. 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 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.