opensourceui
GitHubTwitter/X
  1. Home
  2. Components
  3. Travel
  4. Flight Boarding
Back to Travel

Components / Travel

Flight Boarding

Free Travel React component — FlightBoardingCard. MIT licensed, copy-paste ready for Next.js and Tailwind CSS.

Airline boarding pass with tear line, route codes, seat, gate, boarding time, and passenger name. Travel mockups that feel airport-real.

Preview

Scan

Flight

AI 2847

On Time

CCU

Kolkata

2h 15m

DEL

Delhi

Seat 14AGate B1214:00

Passenger

Bidyut Kundu

T2

Setup

How to use

Free for personal and commercial use. No UI attribution required. Include the MIT copyright notice when copying component source into your project. Read the MIT license.

  1. 1

    Run in your terminal:

    $npm install clsx tailwind-merge lucide-react
  2. 2

    Copy lib/cn.ts below. Skip if you already have cn().

  3. 3

    Copy the code below and create components/travel/flight-boarding-card.tsx in your project.

  4. 4

    Import and render:

    Example

    import { FlightBoardingCard } from "@/components/travel/flight-boarding-card";

    <FlightBoardingCard />

lib/cn.ts

1
2
3
4
5
6
import { type ClassValue, clsx } from "clsx";
import { twMerge } from "tailwind-merge";
 
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs));
}

components/travel/flight-boarding-card.tsx

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
import { forwardRef, type ComponentPropsWithoutRef } from "react";
 
import { cn } from "@/lib/cn";
 
import { PlaneTakeoff } from "lucide-react";
 
export type FlightBoardingCardProps = Readonly<
{
flightNumber?: string;
status?: string;
departureCode?: string;
departureCity?: string;
arrivalCode?: string;
arrivalCity?: string;
duration?: string;
seat?: string;
gate?: string;
boardingTime?: string;
passengerName?: string;
terminal?: string;
} & ComponentPropsWithoutRef<"div">
>;
 
// Production-ready Flight Boarding component — styled with Tailwind CSS.
export const FlightBoardingCard = forwardRef<
HTMLDivElement,
FlightBoardingCardProps
>(
(
{
className,
flightNumber = "AI 2847",
status = "On Time",
departureCode = "CCU",
departureCity = "Kolkata",
arrivalCode = "DEL",
arrivalCity = "Delhi",
duration = "2h 15m",
seat = "14A",
gate = "B12",
boardingTime = "14:00",
passengerName = "Bidyut Kundu",
terminal = "T2",
...props
},
ref,
) => (
<div
ref={ref}
data-slot="flight-boarding-card"
className={cn("w-96 overflow-visible", className)}
{...props}
>
<div
data-slot="flight-boarding-card-container"
className="relative overflow-hidden rounded-3xl border border-neutral-100 bg-white shadow-lg"
>
{/* Ticket Divider */}
<div
data-slot="flight-boarding-card-divider"
className="absolute top-0 bottom-0 left-20 border-l border-dashed border-neutral-200"
/>
 
<div
data-slot="flight-boarding-card-layout"
className="grid grid-cols-[80px_1fr]"
>
{/* Scan Area */}
<div
data-slot="flight-boarding-card-scan"
className="flex flex-col items-center justify-center gap-2 px-8"
>
<span className="text-[9px] tracking-[0.25em] text-neutral-400 uppercase">
Scan
</span>
</div>
 
{/* Main Content */}
<div data-slot="flight-boarding-card-content" className="p-4">
<div
data-slot="flight-boarding-card-header"
className="flex items-center justify-between"
>
<div>
<p className="text-[10px] tracking-[0.2em] text-neutral-400 uppercase">
Flight
</p>
 
<p className="mt-1 text-sm font-semibold text-neutral-900">
{flightNumber}
</p>
</div>
 
<span className="rounded-full bg-emerald-50 px-2 py-1 text-[9px] font-medium text-emerald-600">
{status}
</span>
</div>
 
{/* Route */}
<div
data-slot="flight-boarding-card-route"
className="mt-4 flex items-center justify-between"
>
<div>
<h2 className="text-2xl font-semibold tracking-tight text-neutral-950">
{departureCode}
</h2>
 
<p className="text-[10px] text-neutral-400">{departureCity}</p>
</div>
 
<div className="mx-2 flex flex-1 flex-col items-center">
<div className="relative w-full">
<div className="border-t border-dashed border-neutral-300" />
 
<div className="absolute top-0 left-1/2 -translate-x-1/2 -translate-y-1/2 bg-white px-1.5">
<PlaneTakeoff size={11} className="text-neutral-500" />
</div>
</div>
 
<span className="mt-1.5 text-[9px] text-neutral-500">
{duration}
</span>
</div>
 
<div className="text-right">
<h2 className="text-2xl font-semibold tracking-tight text-neutral-950">
{arrivalCode}
</h2>
 
<p className="text-[10px] text-neutral-400">{arrivalCity}</p>
</div>
</div>
 
{/* Flight Details */}
<div
data-slot="flight-boarding-card-details"
className="mt-4 flex flex-wrap gap-1.5"
>
<span className="rounded-full bg-neutral-100 px-2.5 py-1 text-[10px] text-neutral-700">
Seat {seat}
</span>
 
<span className="rounded-full bg-neutral-100 px-2.5 py-1 text-[10px] text-neutral-700">
Gate {gate}
</span>
 
<span className="rounded-full bg-neutral-100 px-2.5 py-1 text-[10px] text-neutral-700">
{boardingTime}
</span>
</div>
 
{/* Passenger */}
<div
data-slot="flight-boarding-card-footer"
className="mt-3 flex items-center justify-between border-t border-neutral-100 pt-3"
>
<div>
<p className="text-[10px] text-neutral-400">Passenger</p>
 
<p className="mt-1 text-sm font-medium text-neutral-900">
{passengerName}
</p>
</div>
 
<span className="rounded-full bg-neutral-100 px-2.5 py-1 text-[10px] text-neutral-600">
{terminal}
</span>
</div>
</div>
</div>
</div>
</div>
),
);
 
FlightBoardingCard.displayName = "FlightBoardingCard";
PreviousNext

On this

page

Jump to a section on this page.

  • lib/cn.ts
  • components/travel/flight-boarding-card.tsx

Sponsor spot · demo preview

Logo

Your brand name

Your tagline or category

A short pitch about your product or service goes here. This is a preview of how sponsor cards will look in this sidebar.

Your call to action

This slot is available. Sponsor Opensource UI and reach developers browsing components every day.