Skip to content
caliper ui pro docs

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.

Pro

Admit one

Harbour Lights

Fri 14 Nov · Pier 9 · Doors 19:30

Tear the stub off at the door.

When to use

  • Event, travel and cinema tickets, and check-in moments.
  • Coupons and vouchers that are used up.

When not to use

  • Tickets that must be scanned; keep the code visible and add a real scan state.
  • Anything the person might tear by accident; confirm first.

Installation

terminal
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.

API reference

TicketTear

5 props

Also accepts the native props of its root element and a ref.

PropTypeDefaultDescription
title *string—The event or trip, shown large.
detailstring—Date, place and so on, under the title.
seat *string—The seat or entry shown on the stub.
onTear(() => void)—Called once when the stub comes away.
tearLabelstring"Tear off the stub"

Keyboard

  • No custom key handling; Tab and the native activation keys do the work.

Accessibility

It is built on native elements and keeps aria-label and aria-hidden in step with state.

Motion

  • State changes animate with the library's shared durations and curves, so its timing matches every other part.
  • Under reduced motion each change lands on its end state without movement; nothing is hidden or skipped.

Notes for AI

Give your coding assistant this page as Markdown instead of screenshots: the props, keyboard and examples in one file.

/docs/components/ticket-tear.md

The index of every part is at /llms.txt.

More in Surfaces