Travel foundations
What @sdxc/ui/travel is for, the forms-first rules its booking pieces share, and the variables they read.
The pieces of booking a trip: what a stay costs and what guests said about it, and the flights, seats, fares and passes of getting there.
Every choice is a form field and every price or time arrives already formatted, so a booking flow posts without script and reads in the visitor's own locale.
import "@sdxc/ui/theme.css";
import { … } from "@sdxc/ui/travel";When to reach for it
- A booking card whose price breakdown follows the dates and guests.
- Reviews summarised as a score with star and category bars.
- A flight search, its fare classes, a seat map and the boarding pass at the end.
Shared ideas
- Formatted by the callerAmounts, times and durations are strings or nodes you pass, so currency and locale stay yours.
- Named outputsA price line with
namewraps its amount in an<output>, so an island can update it in place. - Choices are inputsFare classes and seats are radio inputs, so the form posts the pick with script off.
CSS variables
Every custom property the namespace reads or declares, with its default and what it controls.
Reads the neutral role for text and hairlines, success for discounts and cheap days, and brand for picks. The roles are documented on Theming.
Shared
The travel pieces read the theme's own tokens; none is declared for them alone.
| Variable | Default | What it controls |
|---|---|---|
--ui-radius-lg | 0.75rem | The corner of cards and fare options. |
--ui-color-success-600 | the success scale | Discount lines and the cheapest days. |