Skip to content

No.119 · Cards

Ticket Card

An event ticket with a perforated stub that loosens on hover and tears away when you click it.

The prompt

Copy this text

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

The design brief behind this component — reuse it to regenerate, remix, or explain it.

Design a printed event ticket rendered as two paper pieces: a main body and a narrow stub. Both are warm off-white with a soft corner highlight and a grounded drop shadow. The body holds a mono date/time kicker, a serif event title, a muted venue line, and a dashed rule above a row of seat details (row, seat, gate) in mono. Two semicircular notches, cut in the page colour, bite into the top and bottom edge where the pieces meet; a column of punched holes (a repeating radial-gradient) forms the perforation down the stub's left edge. The stub is a button. On hover or focus it lifts along its perforation (rotate 4°, nudge 4px) and a tiny "tear ↗" hint fades in. On click it tears away — it rotates 17°, drops 46px, and fades to 25% (700ms, ease-out-expo) — the body squares off its right corners and shifts 6px, the notches disappear, and the stub label changes to "Detached". The stub carries a vertical "Admit one" label, a barcode built from a repeating gradient, and the ticket code. 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: Hover/focus loosens the stub; click/Enter/Space tears it off (one-way). Motion: Stub lift and tear 700ms ease-out-expo; body settle 700ms; fade 500ms. Accessibility: The stub is a real button with aria-pressed and a label that states its action, then its state. Decorative perforation and barcode are aria-hidden. Responsive behavior: Fluid up to 34rem; the stub narrows in small containers. Touch: Tapping tears the stub; there's no hover-only content. 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
Hover/focus loosens the stub; click/Enter/Space tears it off (one-way).
Motion
Stub lift and tear 700ms ease-out-expo; body settle 700ms; fade 500ms.
Accessibility
The stub is a real button with aria-pressed and a label that states its action, then its state. Decorative perforation and barcode are aria-hidden.
Responsive
Fluid up to 34rem; the stub narrows in small containers.
On touch
Tapping tears the stub; there's no hover-only content.