# Ticket — React Native component for Expo

> A boarding pass or event ticket with real notches and a stub you can tear off.

A ticket that feels like one — a boarding pass with a flight path, or an admit-one concert and cinema ticket. Real cut-out notches the screen shows through, a perforated stub with a scan code, seven themes from paper to neon, a holographic badge that shimmers as it tilts, a rubber stamp that thumps down, a flip to a big code and notes — and a stub you can swipe off along the tear line.

- Docs: https://expokit.in/docs/components/ticket-card
- Tier: Pro (ExpoKit Pro plan)
- Also called: boarding pass, event ticket, ticket UI
- Category: 3D
- Platforms: iOS, Android, web
- Expo Go: yes, no development build needed
- npm dependencies: react-native-svg, expo-haptics
- Uses ExpoKit items: kit, tilt-card, flip-card, ticket-shape
- Variants: Boarding Pass, Concert Ticket, Movie Night, Train Pass, Themes, My Tickets

## Installation

This component is part of ExpoKit Pro. With a Pro plan, log the CLI in once and add it like any other item:

```bash
npx @expokit/cli@latest login
```

Plans: https://expokit.in/pricing

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `brand / logo` | `string / ReactNode` | — | Operator, venue or brand (and its logo), top-left. |
| `badge` | `string` | — | Chip top-right ("VIP", "Business") — on holographic foil when holo. |
| `eyebrow` | `string` | — | Small line above the title or route ("Boarding pass · TP 1043"). |
| `title / subtitle` | `string` | — | Event name and details (omit for a route pass). |
| `from / to` | `{ code: string; detail?: string }` | — | Route endpoints; a dashed flight path runs between them. |
| `duration` | `string` | — | Under the flight path ("7h 25m"). |
| `transport` | `"flight" \| "train" \| "bus" \| "boat"` | `"flight"` | Icon riding the flight path. |
| `fields` | `{ label: string; value: string; span?: number }[]` | `[]` | Details grid that wraps onto more rows; span widens a field. |
| `columns` | `number` | `up to 4` | Columns in the details grid. |
| `code` | `string` | — | Printed in the stub and shown big on the back. Omit for a ticket without a stub. |
| `codeType` | `"qr" \| "barcode"` | `"qr"` | Look-alike code style — use renderCode for a scannable one. |
| `renderCode` | `(code: string, size: number) => ReactNode` | — | Draw a real code (e.g. react-native-qrcode-svg). |
| `notes` | `string \| string[]` | — | Lines on the back: terms, baggage, gate notes. |
| `image` | `ImageSourcePropType` | — | Header photo (vertical) or full-bleed art (horizontal). |
| `layout` | `"vertical" \| "horizontal"` | `"vertical"` | Pass with the stub below, or admit-one ticket with the stub on the right. |
| `theme` | `"midnight" \| "paper" \| "aurora" \| "sunset" \| "neon" \| "royal" \| "mint" \| TicketTheme` | `"midnight"` | Preset, or { fill, stub?, ink, soft?, accent, pattern? } — fill can be a gradient. |
| `tone` | `"dark" \| "light"` | — | Shorthand for theme: midnight / paper. |
| `accent` | `string` | `theme accent` | Route line, badge and stamp colour. |
| `holo` | `boolean` | `false` | Rainbow foil glare and a holographic badge. |
| `stamp / stampColor` | `string / string` | `— / accent` | Rubber stamp across the ticket ("CHECKED IN"); thumps in when set. |
| `onTear` | `() => void` | — | Enables swiping the stub off along the tear line; called once it's gone. |
| `torn` | `boolean` | — | Controlled torn state (the stub is gone, the torn edge stays). |
| `flipped / defaultFlipped / onFlip` | `boolean / boolean / (flipped) => void` | `— / false / —` | Controlled or uncontrolled side (tap to flip). |
| `tilt` | `boolean` | `true` | Tilt toward the finger; false for long lists. |
| `radius` | `number` | `22` | Corner radius. |
| `labels` | `{ scan?, admit?, tear?, back? }` | `English` | Every built-in string, for translation. |
| `style` | `StyleProp<ViewStyle>` | — | Style for the root (width, margins). |
| `className` | `string` | — | Tailwind classes on the root when using NativeWind or Uniwind. Prefer style for StyleSheet overrides. |

## Behaviour & accessibility

- **Touch**: The card tilts toward your finger (tilt={false} turns it off). Tap to flip it to the big code and notes; with onTear set, swipe the stub sideways to tear it off.
- **Motion**: A holo badge shimmers as the card leans, a stamp thumps down when set, and a torn stub falls away along the tear line.
- **Haptics**: A success notification when the stub tears off.
- **Screen readers**: One element whose label joins the brand, title or route, every field and the stamp; it is a button when there is a back to flip to.

## FAQ

### How do I make a boarding pass in React Native?

Use ExpoKit's Ticket, a Pro component: with ExpoKit Pro, the ExpoKit CLI copies a ready-made boarding pass into your Expo or React Native app as plain TypeScript you can edit. It works on iOS, Android and web, and in Expo Go.

### Does Ticket work in Expo Go?

Yes. Ticket runs in Expo Go on iOS and Android with no development build — its packages (react-native-svg, expo-haptics) are all included in Expo Go.

### How do I add Ticket to my Expo app?

With ExpoKit Pro, add it with the ExpoKit CLI: it copies the component's source into your app and installs react-native-svg, expo-haptics, so the code is yours to change. The install command is on this page for Pro members.

### Is Ticket free?

Ticket is part of ExpoKit Pro. With a Pro plan, log the CLI in once and it installs the full source into your app.

## More

- Live preview, variants and code: https://expokit.in/docs/components/ticket-card
- Every ExpoKit component, screen, template and chart: https://expokit.in/llms.txt
- Install commands and props for every free component: https://expokit.in/llms-full.txt
- Pricing: https://expokit.in/pricing
