Pro
Ticket tear
A ticket with a perforated stub. Drag the stub away and it peels about its lower corner; let go past halfway and it tears off and falls, and the ticket settles with a small recoil.
pnpm dlx shadcn@latest add @caliper/ticket-tearWhen to use
Use it for
- Event, travel and cinema tickets, and check-in moments.
- Coupons and vouchers that are used up.
Skip it when
- Tickets that must be scanned; keep the code visible and add a real scan state.
- Anything the person might tear by accident; confirm first.
Decisions
Why it is built this way, so you know what to keep when you change your copy.
Behaviour
- Halfway decides
- Past halfway it tears; short of that it springs back, so a tentative pull is safe.
Styling
- Notches cut from the shape
- The notches are masks, not painted circles, so they work on any background, and the hairline follows them.
Usage
- A button as well as a drag
- Enter or Space tears the stub, and the button says which seat it is.
Installation
pnpm dlx shadcn@latest add @caliper/ticket-tear
Adds its 2 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 { TicketTear } from "@/components/ui/ticket-tear"
The worked example comes with Pro
The 30-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
TicketTear
component
Also accepts the native props of its root element and a ref.
Accessibility
It is built on native elements and keeps aria-label and aria-hidden in step with state.
No custom key handling; Tab and the native activation keys do the work.
Motion
It checks prefers-reduced-motion itself and settles immediately instead of travelling. Every state is still reachable.
Related
- Wallet cardA payment card with brand, last four digits and actions.
- Receipt revealAn order confirmation that prints line by line with the total stamped last, so a purchase feels finished. All of it is readable from the start.
- Sticker peelStickers you peel off a surface. Press one and the corner nearest your finger curls back over a fold; keep holding and it lifts free and follows you; let go and it presses flat again with a little squash.