Boarding pass card
A boarding pass with a notched ticket outline, a faint dotted world map, the route, a detail strip and a stub with a barcode and seat box.
npx @swipeui/cli add boarding-pass-cardWhen to use it
- The next flight on a travel or trips screen, with the route, gate, seat and boarding time at a glance.
- A booking confirmation that should feel like the real pass.
- Train, coach or ferry tickets that follow the same from, to and seat layout.
- A wallet of upcoming trips, one pass per trip, with the departs-in pill above each.
When not to use it
- Event tickets with a date block and RSVP. Event card fits better.
- A scannable pass people show at the gate. The barcode here is decorative; render a real code from your server.
- Receipts or itineraries with many legs; build a list screen.
- Narrow columns under about 320pt with the stub on. Set stub={false} or give the pass full width.
Installation
Installs with a Pro licence
Everything on this page is public except the source. Founder pre-sale opens around 5 January 2027.
Usage
import { router } from 'expo-router';
import {
BOARDING_PASS_MIDNIGHT,
BoardingPassCard,
} from '@/components/swipeui/card/boarding-pass-card';
<BoardingPassCard
airline="Northwind Air"
airlineMark={<NorthwindMark />}
boardingTime="5:30 AM"
passenger="Alex Morgan"
from={{ code: 'SFO', city: 'San Francisco' }}
to={{ code: 'SEA', city: 'Seattle' }}
details={[
{ label: 'Gate', value: 'A9' },
{ label: 'Date', value: '4 Sep' },
{ label: 'Flight', value: 'NW 159' },
{ label: 'Seat', value: '12A' },
]}
seat="12A"
departsIn="Departs in 10h 35m"
palette={BOARDING_PASS_MIDNIGHT}
onPress={() => router.push('/trips/nw159')}
/>;Examples
import { BoardingPassCard } from '@/components/swipeui/card/boarding-pass-card';
// Narrow columns: drop the stub and take the fill from the theme.
<BoardingPassCard {...trip} stub={false} tone="secondary" />;import { BoardingPassCard } from '@/components/swipeui/card/boarding-pass-card';
// Every word is a prop, so the same pass works for trains and other languages.
<BoardingPassCard
label="Billet de train"
airline="Ligne Azur"
boardingLabel="Départ"
boardingTime="08:12"
passengerLabel="Voyageur"
passenger="Camille Durand"
routeLabels={['De', 'À']}
from={{ code: 'LYS', city: 'Lyon' }}
to={{ code: 'MRS', city: 'Marseille' }}
details={[
{ label: 'Voie', value: '4' },
{ label: 'Voiture', value: '12' },
{ label: 'Place', value: '61' },
]}
seatLabel="Place"
seat="61"
map={false}
/>;API reference
BoardingPassCardProps
| Prop | Type | Default | Description |
|---|---|---|---|
label? | | | The pass's heading. |
airline | | — | The airline's name, beside its mark. |
airlineMark? | | — | The airline's mark, such as a small SVG. Use your own; never another airline's. |
boardingLabel? | | | The label above the boarding time. |
boardingTime | | — | When boarding starts, exactly as it should read, such as "5:30 AM". |
passengerLabel? | | | The label above the passenger. |
passenger | | — | The passenger's full name. |
passengerShort? | | | A shorter name for the stub. |
from | | — | Where the flight leaves from. |
to | | — | Where it lands. |
routeLabels? | | | The labels over the two codes. |
details | | — | The detail strip's columns, such as Gate, Date, Flight and Seat. Two to five fit. |
seat | | — | The seat, shown large in the stub's seat box. |
seatLabel? | | | The label in the stub's seat box. |
departsIn? | | — | A pill above the pass, such as "Departs in 10h 35m". Hidden when unset. |
barcodeSeed? | | | Seeds the decorative barcode, so the same pass always draws the same bars. |
map? | | | The faint dotted world map behind the main panel. |
stub? | | | The stub with the barcode and seat box. Turn it off on narrow layouts. |
tone? | | | The main panel's fill from the theme. |
palette? | | | Your own colours, over the tone's. |
onPress? | | — | Opens the trip. Without it the pass is a static surface. |
disabled? | | | Prevents pressing and dims the pass. |
haptics? | | | A light haptic tap when pressed. |
motion? | | | Press character. |
accessibilityLabel? | | | What a screen reader announces. |
accessibilityHint? | | — | Says what pressing does, such as "Opens the trip". |
className? | | — | Classes merged over the root, which holds the pill and the pass. |
style? | | — | Native style escape hatch for the root. |
testID? | | — | Root identifier; parts add |
Composition and behavior
- The pass is one SVG outline with real semicircular notches at the seam between the main panel and the stub, so any background shows through the cut-outs and around the edges.
- The main panel holds the label, the airline mark and name, the boarding time, the passenger, the route (codes, cities and a dotted line with a plane) and a detail strip. A faint dotted world map, sampled from Natural Earth's public-domain land outlines, fades in behind its top end.
- The stub holds a decorative barcode along the seam, the airline, a short passenger name, the route codes, the boarding time and a seat box. It's about a third of the width (116 to 160pt); stub= removes it and the notches. When the main panel is narrower than 250pt the type steps down one size, so long words never break.
- The pass is read as one element in order; the barcode, map and route art are hidden. With onPress it's one button.
- In right-to-left layouts the stub stays at the end, the outline mirrors and the plane points the reading direction, while the map keeps its geography.
Pass settings
| Prop | Does | Default |
|---|---|---|
| stub | Shows the stub with the barcode and seat box | true |
| map | Shows the faint dotted world map | true |
| tone | Fills the main panel from the theme | primary |
| palette | Your own colours; BOARDING_PASS_MIDNIGHT is a ready navy set | theme colours |
| departsIn | The pill above the pass | hidden |
| barcodeSeed | Fixes the decorative barcode | route and passenger |
| onPress | Makes the pass one button | none (static) |
| haptics | A light tap when pressed | true |
Text settings
| Prop | Does | Default |
|---|---|---|
| label | The pass's heading | Boarding pass |
| boardingLabel | Above the boarding time | Boarding |
| passengerLabel | Above the passenger | Passenger |
| routeLabels | Above the two codes | From, To |
| seatLabel | In the seat box | Seat |
| passengerShort | The stub's shorter name | passenger |
Behavior and gestures
- With onPress the whole pass is one button: it presses in slightly with a light haptic and opens the trip.
- Every text is a prop: label, airline, boardingLabel, boardingTime, passengerLabel, passenger, passengerShort, from, to, routeLabels, details, seat, seatLabel and the departsIn pill (hidden when unset).
- stub={false} removes the stub, its barcode and the notches; map={false} removes the dotted world map.
- tone fills the main panel from the theme; palette paints the pass in your own colours, and BOARDING_PASS_MIDNIGHT is a ready navy set.
- barcodeSeed fixes the decorative barcode; by default it comes from the route and passenger, so a pass always draws the same bars.
Accessibility
- The pass is one element read in order, for example "Boarding pass, Alex Morgan, Northwind Air, from San Francisco to Seattle, boarding 5:30 AM, Gate A9, Date 4 Sep, Flight NW 159, Seat 12A, Departs in 10h 35m".
- The barcode, the map, the route line and the plane are decorative and hidden from screen readers.
- With onPress it's a button; add accessibilityHint to say where it goes.
- In right-to-left layouts the stub stays at the end, the outline mirrors and the plane points the reading direction; the map keeps its geography.
- Text follows Dynamic Type; detail values shrink slightly to fit their column before truncating.
Motion
- Uses the
pressmotion role, so it follows your app's feel. Passmotionto tune this one instance. - The pass scales on the press role when it has onPress. Nothing else moves, so it reads as a still document.
- Under Reduce Motion the press doesn't scale; only the haptic and the action remain.
Performance
- The outline, map and barcode are three SVG paths (the map's 854 dots are one path), rebuilt only when the pass is measured or its route changes.
Notes for AI
- Invent airline names and marks for demos; never use a real airline's name or logo.
- Pass details in reading order, usually Gate, Date, Flight and Seat; two to five columns fit.
- Format times and dates yourself (boardingTime, details) for the user's locale.
- Use stub={false} in narrow layouts such as split views, and palette for an airline's own colours.
Compatibility
| Runs on | Supported |
|---|---|
| Expo SDK 57 | Yes |
| Expo SDK 58 | Yes |
| React Native CLI (with Expo modules) | Yes |
| Expo Go | Yes |
| iOS | Yes |
| Android | Yes |
This table describes API support and static bundle checks. Native runtime, device accessibility and bare Uniwind compatibility remain pending.