Pro
Ticket stub
A ticket with a perforated stub. Checking in tears the stub off along the perforation, so used is something you can see on the ticket and not only read. The tear is the feedback; the plain text line on the ticket is the record.
pnpm dlx shadcn@latest add @caliper/ticket-stubGate check-in, Platform 3
Mira Solheim · Friday 23 October
Press Check in, or pull the stub down.
When to use
Use it for
- Check-in, redeem and validate flows that cannot be repeated by accident.
- Showing that a booking, coupon or pass has been used.
Skip it when
- Reversible toggles; use a switch.
- Anything that must stay readable for years; the ticket is a status, not an archive.
Decisions
Why it is built this way, so you know what to keep when you change your copy.
Behaviour
- Nothing depends on dragging
- Check in is a button with a live status. The stub can also be pulled down with a mouse or finger, past 60px it tears.
- Undo takes focus
- After the tear the Check in button is replaced by Undo, and focus lands on it so the next key press is the way back.
Styling
- The tear is the only animation
- Under reduced motion the stub is gone at once and the ticket keeps its text line.
Installation
pnpm dlx shadcn@latest add @caliper/ticket-stub
Adds its 7 files to components/ui/, each with its own stylesheet, and installs their packages. Pro installs with your access token, set up once per project. See Pro access. The first part also adds Caliper UI’s tokens; import them once as in Installation.
Usage
Import it from your copy of the source. The example behind the preview comes with the source.
import { TicketStub } from "@/components/ui/ticket-stub"
The worked example comes with Pro
The 26-line example behind the preview opens here, ready to copy.
- 626 Pro parts, blocks and page templates, all with source
- $149 once, with lifetime updates. No renewal
- A full refund within 14 days if it is not for you
API reference
TicketStub
component
Accessibility
It exposes group semantics, with aria-label, aria-hidden and aria-live kept in step with state. Changes that matter are announced through a live region.
No custom key handling; Tab and the native activation keys do the work.
Motion
It declares no animation in its component source. Any transition comes from its stylesheet, which uses the duration tokens that collapse to instant under prefers-reduced-motion.
Related
- Helpdesk ticketOne ticket on a page: the conversation, internal notes and every change in one history; reply or note with saved replies and the status it leaves in; details, the customer's plan and value, their other tickets, and merging.
- Swipe actionsRow actions revealed by swiping, with a keyboard route to the same actions.
- ChecklistA list people tick through: a ticked item is struck out where it is, then settles into Done at the bottom, so what is left stays at the top. Add from the last row, reorder with Alt+arrows, undo from the line that confirms it.