FlightItinerary
A journey of one or more legs.
Flight details
- 18:10MRW Merrow2h 15mNonstop20:25VLS Vellis
- Aerion 320neo
- Economy
- 10h 05m layover in VLS VellisOvernight · change terminals
- 06:30VLS Vellis3h 00mNonstop09:30OSK Oskarn
- Aerion 220
- Economy
View code
<FlightItinerary
title="Outbound · Fri 14 Mar"
airline="Larkwing Air"
departure={{ time: "18:10", code: "MRW", city: "Merrow" }}
arrival={{ time: "09:30", code: "OSK", city: "Oskarn" }}
duration="15h 20m"
stops={1}
stopsLabel="1 stop"
dayOffset="+1"
dayOffsetLabel="arrives the next day"
toggleLabel="Flight details"
open
>
<FlightItinerary.Segment airline="Larkwing Air" flightNumber="LW 214" … />
<FlightItinerary.Layover tone="warning" note="Overnight · change terminals">
10h 05m layover in VLS Vellis
</FlightItinerary.Layover>
<FlightItinerary.Segment airline="Larkwing Air" flightNumber="LW 731" … />
</FlightItinerary>Installation
An ordinary dependency: install it, import the theme once, and import the component where it is used.
npm add @sdxc/ui remiximport "@sdxc/ui/theme.css";Usage
import { FlightItinerary } from "@sdxc/ui/travel";Renders the journey: a <section> with the title, stop count and total duration over the trip
on one FlightRoute line, then a <details> whose <summary> is the toggle and whose
body is an ordered list of legs and layovers, so the legs open and close with no script.
Composition
The parts the component publishes, each a static property of the host.
FlightItineraryFlightItinerary.SegmentRenders one leg of the journey as a list item holding a FlightSegment.FlightItinerary.LayoverRenders the connection between two legs as a tinted row with a glyph, the caller's words and an optional note.
Props
Read from the component's own types, so every prop, every default and every allowed value is listed.
| Prop | Type | Required | Description |
|---|---|---|---|
title | RemixNode | No | What the journey is, such as "Outbound · Fri 14 Mar", over the summary line. |
airline | RemixNode | No | Who flies it, such as "Larkwing Air" or "Larkwing Air, Fenwick Connect". |
departure | FlightRoute.Endpoint | Yes | Where the whole journey starts. |
arrival | FlightRoute.Endpoint | Yes | Where the whole journey ends. |
duration | RemixNode | Yes | The whole journey's duration, layovers included, such as "9h 40m". |
stops | number | No | How many stops the summary line draws. |
stopsLabel | RemixNode | No | The stop count as words, such as "Nonstop" or "1 stop". |
dayOffset | string | No | The badge after the final arrival time, such as "+1". |
dayOffsetLabel | string | No | What the day badge means, read in its place. |
labels | FlightRoute.Labels | No | Hidden words that make the summary line a sentence; see FlightRoute.Labels. |
toggleLabel | RemixNode | Yes | The words on the disclosure's toggle, such as "Flight details". |
open | boolean | No | Starts with every leg showing. |
children | RemixNode | Yes | The FlightItinerary.Segment and FlightItinerary.Layover items, in order. |
Also accepts everything in Omit<TagProps<"section">, "title">.
FlightItinerary.Segment
Also accepts everything in FlightSegment.Props.
FlightItinerary.Layover
| Prop | Type | Required | Description |
|---|---|---|---|
children | RemixNode | Yes | The connection in words, such as "1h 35m layover in VLS Vellis". |
note | RemixNode | No | A second line, such as "Overnight · change terminals". |
tone | "default" | "warning" | No | |
icon | RemixNode | No | A glyph before the words; a clock, or an alert for a warning, when left out. |
Also accepts everything in Omit<TagProps<"li">, "children">.
Types
| Name | Values | What it decides |
|---|---|---|
LayoverTone | "default" | "warning" | "warning" flags a connection worth a second look: a short one, an overnight one. |