Skip to content

shadcn.io is an independent project built on shadcn/ui

Flight Product Card Block for React Aria

One flight drawn as a route line with a layover and a next-day arrival, three fare columns that list what each includes, and extra checked bags that add into a total.

Preview

Preview width

Installation

Part of Pro
Pro unlocks the code and one-line install of every Pro button and text effect, plus the MCP for your AI editor.
Have Pro already? Sign in to open it.Opens here as soon as you're Pro.

Overview

Show what a fare really includes before the price decides it with this flight card for React with React Aria. A hairline frame opens with the route: the departure time and city, a line with a layover dot and its length, and the arrival, with a sentence that says in words when it lands the next day. Below it three fare columns (Light, Standard, Flex) are native radios, each with its price and a list of carry-on, checked bag, seat and changes, drawn as a check or a dash with a word. A stepper adds up to two extra checked bags, and a description list adds the fare, the taxes and the extra bags into a total from integer cents. One Shine Button holds the fare. For airlines, trains, coaches and ferries with tiered fares.

FAQ

How do I change the fares and what they include?

Edit the LIGHT, STANDARD and FLEX constants: each has a price and taxes in cents, the number of checked bags included and four perks, each marked has or not with a word. The extra bag price is EXTRA_BAG_CENTS.

How are the bags counted?

The fare includes some (none, one or two), and the stepper adds extra ones up to MAX_EXTRA. The line under the stepper spells it out ("2 bags checked (1 included, 1 extra)") and the total adds only the extra bags' price.

Is the route live?

No. The times, the cities and the layover are typed in the file, as is the next-day note. A real card would take them from a fare search result and work out the next-day wording from the two local dates.

What stays local, and how do I wire it for real?

The held fare is page state; nothing is booked, priced or sent. Replace the constants with your fare search result and the body of hold with a call that creates the reservation.

How does it look on a phone?

The route line stays on one row, the fare columns stack as full-width cells that each keep their list, and the bag and total cell goes below them.

Is it accessible?

The fares are a fieldset of native radios whose label reads the name, price and each perk with its word, so a check or a dash is never the only signal. The totals are a description list and a polite status line announces changes.