Skip to content
VenusUI
Get started

Boarding Pass

A flight boarding pass with a perforated stub and code that flips to the fare and baggage details.

Preview

Installation

npx shadcn@latest add @venusui/boarding-pass

Run this in a project set up with shadcn. If you haven’t set it up yet, run npx shadcn@latest init first.

Files added to your project

Paths use the default shadcn aliases. The CLI follows the aliases in your components.json.

  • @/components/ui/boarding-pass.tsx

Usage

The code behind the preview above.

boarding-pass-demo.tsx

import { BoardingPass } from "@/components/ui/boarding-pass"

// The airline and passenger are made up.
export default function BoardingPassDemo() {
  return (
    <BoardingPass
      className="w-[min(22rem,calc(100vw-3rem))]"
      airline="Skylark Air"
      flight="SK 208"
      from={{ code: "LHR", city: "London" }}
      to={{ code: "HND", city: "Tokyo" }}
      date="Tue, 7 Apr"
      departs="19:05"
      arrives="16:40 +1"
      passenger="Priya Natarajan"
      seat="24A"
      gate="B32"
      boarding="18:15"
      cabin="Economy"
      reference="K7PX2Q"
      details={[
        { label: "Fare", value: "Economy Flex" },
        { label: "Checked bag", value: "1 × 23 kg" },
        { label: "Cabin bag", value: "1 × 10 kg" },
        { label: "Seat", value: "Window, extra legroom" },
        { label: "Meal", value: "Vegetarian" },
      ]}
    />
  )
}

API reference

PropTypeDefaultDescription
airline, flightstring—Shown in the header band.
from, to{ code: string; city: string }—Airports: IATA code and city.
date, departs, arrivesstring—e.g. “Tue, 7 Apr”, “19:05”, “16:40 +1”.
passenger, seat, gate, boardingstring—The main fields.
cabinstring"Economy"Shown on the stub and the back.
referencestring—Booking reference, printed on the stub and drawn into the code.
details{ label: string; value: string }[]—Rows on the back, e.g. fare, baggage and meal.

All <button> props except children; className sets the width (the pass is about 5:8).

Requirements

  • lucide-react for the plane. React 19 and Tailwind CSS v4.

Customization

  • The code is a decorative pattern, not scannable. For a real pass, put a QR image from your backend in the stub instead.

Accessibility

  • It's a button with aria-pressed; its label reads the flight, route, date, seat, gate and boarding time.
  • With reduced motion it flips without animation.

Troubleshooting

The back shows through.
A parent is flattening 3D (overflow-hidden or filter). Keep the pass's wrapper free of those.
Unknown registry "@venusui"
Your shadcn CLI couldn’t find the namespace in the shadcn registry index. Use the latest CLI (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 found
Run npx shadcn@latest init in your project first.
Loading preview

A card that tilts in 3D toward the pointer with spring physics.

Loading preview

Stacked cards with the next ones peeking out; Next sends the top card to the back.

Loading preview

A card that tilts toward the pointer while its layers rise off the surface, each to its own depth.