SwipeUI

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-card
Variant
Preset
Material
Scheme
Feel
Interactive web demo. Native materials, gestures and system presentation differ on device.

When 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

app/trips.tsx
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

app/split-view.tsx
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" />;
app/train.tsx
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

PropTypeDefaultDescription
label?string'Boarding pass'

The pass's heading.

airlinestring—

The airline's name, beside its mark.

airlineMark?ReactNode—

The airline's mark, such as a small SVG. Use your own; never another airline's.

boardingLabel?string'Boarding'

The label above the boarding time.

boardingTimestring—

When boarding starts, exactly as it should read, such as "5:30 AM".

passengerLabel?string'Passenger'

The label above the passenger.

passengerstring—

The passenger's full name.

passengerShort?stringpassenger

A shorter name for the stub.

fromBoardingPassPlace—

Where the flight leaves from.

toBoardingPassPlace—

Where it lands.

routeLabels?readonly [string, string]['From', 'To']

The labels over the two codes.

detailsreadonly BoardingPassDetail[]—

The detail strip's columns, such as Gate, Date, Flight and Seat. Two to five fit.

seatstring—

The seat, shown large in the stub's seat box.

seatLabel?string'Seat'

The label in the stub's seat box.

departsIn?string—

A pill above the pass, such as "Departs in 10h 35m". Hidden when unset.

barcodeSeed?stringfrom, to and passenger

Seeds the decorative barcode, so the same pass always draws the same bars.

map?booleantrue

The faint dotted world map behind the main panel.

stub?booleantrue

The stub with the barcode and seat box. Turn it off on narrow layouts.

tone?BoardingPassTone'primary'

The main panel's fill from the theme.

palette?BoardingPassPalettethe theme's colours

Your own colours, over the tone's.

onPress?(() => void)—

Opens the trip. Without it the pass is a static surface.

disabled?booleanfalse

Prevents pressing and dims the pass.

haptics?booleantrue

A light haptic tap when pressed.

motion?MotionOverridethe app's feel

Press character.

accessibilityLabel?stringthe pass's details, joined

What a screen reader announces.

accessibilityHint?string—

Says what pressing does, such as "Opens the trip".

className?string—

Classes merged over the root, which holds the pill and the pass.

style?StyleProp<ViewStyle>—

Native style escape hatch for the root.

testID?string—

Root identifier; parts add -ticket, -outline, -map, -stub, -barcode and -departs.

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

PropDoesDefault
stubShows the stub with the barcode and seat boxtrue
mapShows the faint dotted world maptrue
toneFills the main panel from the themeprimary
paletteYour own colours; BOARDING_PASS_MIDNIGHT is a ready navy settheme colours
departsInThe pill above the passhidden
barcodeSeedFixes the decorative barcoderoute and passenger
onPressMakes the pass one buttonnone (static)
hapticsA light tap when pressedtrue

Text settings

PropDoesDefault
labelThe pass's headingBoarding pass
boardingLabelAbove the boarding timeBoarding
passengerLabelAbove the passengerPassenger
routeLabelsAbove the two codesFrom, To
seatLabelIn the seat boxSeat
passengerShortThe stub's shorter namepassenger

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 press motion role, so it follows your app's feel. Pass motion to 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 onSupported
Expo SDK 57Yes
Expo SDK 58Yes
React Native CLI (with Expo modules)Yes
Expo GoYes
iOSYes
AndroidYes

This table describes API support and static bundle checks. Native runtime, device accessibility and bare Uniwind compatibility remain pending.

Related items