shadcn.io is not affiliated with official shadcn/ui
Flight Booking Chat Block for Radix UI
A travel agent's thread with a card of three flights as a radio group, the other two folding away once you choose, a fare breakdown in integer cents that re-derives with the cabin, fare rules and a Reserve button.
Installation
Overview
Show a flight booked in conversation, with this flight booking chat for React with Radix UI. A hairline frame holds a window of fixed height for Skyferry, a travel agency: the agent, Rosalind Ketteridge, posts a card of three flights with times, airport codes joined by a dashed connector, the duration and the fare from. Choosing one folds the other two into a single line with a Show them button, and the fare card below it breaks the price into base fare, taxes, a booking fee and the total, with change, cancel and checked bag rules that follow the Economy, Premium and Business Toggle Group. Reserve posts your line and a confirmation card with a typed reference. The composer's Shine Button is the only colored control.
FAQ
What stays in the page, and how do I make it real?
Everything. The replies come from a short typed script in this file, picked by words in your message, then one fallback per message and a last line that says it was the last sample reply. The fares, the reference and the reservation are typed or derived here. Nothing is sent and no model runs, as the line under the composer says. To wire it for real, send the choice from reserve to your booking service, price the fare there and replace FLIGHTS and CABINS.
How is the fare calculated?
In integer cents. The base is the economy fare times the cabin's percentage, rounded once; taxes are 14% of the base, rounded once; the booking fee is typed; the total is their sum. Nothing divides cents by a hundred before multiplying, so the lines always add up. All figures are examples.
What happens to the other flights?
Choosing a flight folds the radio group down to that one flight and shows Show them, which brings all three back without losing your pick. Reserving locks the group, the cabin switch and the button.
How does the composer work?
Enter sends and Shift and Enter add a line, which the field's description says for a screen reader; Enter during text composition (an IME) is left alone. The field grows with its content up to a limit. Send stays quiet while the field is empty and says so if pressed, and focus stays in the field after sending.
Is it usable with a keyboard and a screen reader?
The log is a focusable region announced as a log, so new messages are read out once, and every message starts with a hidden name and time. The flights are native radios in a fieldset, so arrow keys move between them, and every fare line is a term and a value. The avatars are hidden from assistive technology because the name is always in text.