Loading preview
Animated Card
CardsA card that tilts in 3D toward the pointer with spring physics.
A ticket with a perforated stub you can drag or click to tear off.
npx shadcn@latest add @venusui/event-ticketRun this in a project set up with shadcn. If you haven’t set it up yet, run npx shadcn@latest init first.
Paths use the default shadcn aliases. The CLI follows the aliases in your components.json.
@/components/ui/event-ticket.tsxThe code behind the preview above.
event-ticket-demo.tsx
"use client"
import * as React from "react"
import { RotateCcw } from "lucide-react"
import { EventTicket } from "@/components/ui/event-ticket"
// Photo: Unsplash (free under the Unsplash License). The event is made up.
export default function EventTicketDemo() {
const [ticket, setTicket] = React.useState(0)
const [torn, setTorn] = React.useState(false)
return (
<div className="flex w-[min(34rem,calc(100vw-2rem))] flex-col items-center gap-5">
<EventTicket
key={ticket}
onTornChange={setTorn}
event="Golden Hour Live: Mara Lune"
date="Sat, 14 Mar 2026"
time="Doors 19:00"
venue="The Roundhouse, Hall B"
seat="Floor · General admission"
code="GHL-0314-8842"
image={{
src: "https://images.unsplash.com/photo-1459749411175-04bf5292ceea?w=900&h=320&fit=crop&auto=format&q=75",
alt: "A crowd with raised hands under golden stage lights",
}}
/>
<p className="flex items-center gap-3 text-sm text-muted-foreground">
{torn ? "Enjoy the show!" : "Drag the stub to tear it off."}
{torn ? (
<button
type="button"
onClick={() => {
setTicket((n) => n + 1)
setTorn(false)
}}
className="inline-flex items-center gap-1 rounded-md border px-2 py-1 text-xs hover:text-foreground"
>
<RotateCcw aria-hidden="true" className="size-3" /> New ticket
</button>
) : null}
</p>
</div>
)
}
| Prop | Type | Default | Description |
|---|---|---|---|
| event, date, time, venue | string | — | Printed on the ticket. |
| seat | string | "General admission" | Printed on the stub. |
| image | { src: string; alt: string } | — | Photo across the top of the ticket. |
| code | string | — | Printed under the barcode; the barcode pattern is drawn from it. |
| torn, defaultTorn | boolean | — | Controlled or initial torn state. |
| onTornChange | (torn: boolean) => void | — | Called when the stub is torn off. |
All <div> props.
key (the demo's “New ticket” button does this).touch-pan-y); drag sideways, or tap to tear.Unknown registry "@venusui"npx shadcn@latest), install by URL, or register it with its address: npx shadcn@latest registry add @venusui=https://venusui.com/r/{name}.json.No components.json foundnpx shadcn@latest init in your project first.A card that tilts in 3D toward the pointer with spring physics.
A flight boarding pass with a perforated stub and code that flips to the fare and baggage details.
Stacked cards with the next ones peeking out; Next sends the top card to the back.