SearchCtrlK

  • ↑↓navigate
  • ↵open
  • escclose

Can’t find it? Contact us

FlightItinerary

A journey of one or more legs.

Outbound · Fri 14 MarLarkwing Air1 stop · 15h 20m
18:10MRW Merrow
15h 20m
09:30 arrives the next dayOSK Oskarn
Flight details
  1. Larkwing AirLW 214
    18:10MRW Merrow
    2h 15mNonstop
    20:25VLS Vellis
    • Aerion 320neo
    • Economy
  2. 10h 05m layover in VLS VellisOvernight · change terminals
  3. Larkwing AirLW 731
    06:30VLS Vellis
    3h 00mNonstop
    09:30OSK Oskarn
    • Aerion 220
    • Economy
View code
tsx
<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.

Terminal
npm add @sdxc/ui remix
typescript
import "@sdxc/ui/theme.css";

Usage

typescript
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.

  • FlightItinerary
  • FlightItinerary.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.

PropTypeRequiredDescription
titleRemixNodeNoWhat the journey is, such as "Outbound · Fri 14 Mar", over the summary line.
airlineRemixNodeNoWho flies it, such as "Larkwing Air" or "Larkwing Air, Fenwick Connect".
departureFlightRoute.EndpointYesWhere the whole journey starts.
arrivalFlightRoute.EndpointYesWhere the whole journey ends.
durationRemixNodeYesThe whole journey's duration, layovers included, such as "9h 40m".
stopsnumberNoHow many stops the summary line draws.
stopsLabelRemixNodeNoThe stop count as words, such as "Nonstop" or "1 stop".
dayOffsetstringNoThe badge after the final arrival time, such as "+1".
dayOffsetLabelstringNoWhat the day badge means, read in its place.
labelsFlightRoute.LabelsNoHidden words that make the summary line a sentence; see FlightRoute.Labels.
toggleLabelRemixNodeYesThe words on the disclosure's toggle, such as "Flight details".
openbooleanNoStarts with every leg showing.
childrenRemixNodeYesThe 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

PropTypeRequiredDescription
childrenRemixNodeYesThe connection in words, such as "1h 35m layover in VLS Vellis".
noteRemixNodeNoA second line, such as "Overnight · change terminals".
tone"default" | "warning"No
iconRemixNodeNoA glyph before the words; a clock, or an alert for a warning, when left out.

Also accepts everything in Omit<TagProps<"li">, "children">.

Types

NameValuesWhat it decides
LayoverTone"default" | "warning""warning" flags a connection worth a second look: a short one, an overnight one.
@sdxc/ui

Can’t find it? Contact us