SearchCtrlK

  • ↑↓navigate
  • ↵open
  • escclose

Can’t find it? Contact us

FlightOption

One row of flight search results.

  1. Cheapest
    • Larkwing Air
      08:40MRW Merrow
      2h 15mNonstop
      10:55VLS Vellis
    • Larkwing Air
      22:10VLS Vellis
      7h 55m1 stop · OSK
      06:05 arrives the next dayMRW Merrow

    $412Round trip per person

  2. Fastest
    • Fenwick Connect
      07:15MRW Merrow
      2h 05mNonstop
      09:20VLS Vellis
    • Fenwick Connect
      19:40VLS Vellis
      2h 10mNonstop
      21:50MRW Merrow

    $468Round trip per person

View code
tsx
<FlightOption
	aria-label="Larkwing Air, $412"
	price="$412"
	priceDetail="Round trip per person"
	badges={<Badge color="success" variant="secondary">Cheapest</Badge>}
	action={<Button type="submit" name="option" value="lw-214">Select</Button>}
	featured
>
	<FlightOption.Journey airline="Larkwing Air" departure={{ time: "08:40", code: "MRW" }}
		arrival={{ time: "10:55", code: "VLS" }} duration="2h 15m" stopsLabel="Nonstop" />
	<FlightOption.Journey airline="Larkwing Air" departure={{ time: "22:10", code: "VLS" }}
		arrival={{ time: "06:05", code: "MRW" }} duration="7h 55m" stops={1}
		stopsLabel="1 stop · OSK" dayOffset="+1" dayOffsetLabel="arrives the next day" />
</FlightOption>

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 { FlightOption } from "@sdxc/ui/travel";

Renders the row as an <article>: badges, then each FlightOption.Journey, then the price, its detail and the action. A list of these, each in an <li>, makes a results page; name each one with aria-label (such as "Larkwing Air, $412") so a list reads at a glance.

Composition

The parts the component publishes, each a static property of the host.

  • FlightOption
  • FlightOption.JourneyRenders one direction of the trip as a list item: the airline's mark and name over the FlightRoute, so outbound and return lines stack with their routes aligned.

Props

Read from the component's own types, so every prop, every default and every allowed value is listed.

PropTypeRequiredDescription
priceRemixNodeYesThe fare, formatted by the caller, such as "$412".
priceDetailRemixNodeNoWhat the fare covers, such as "Round trip per person", under the price.
badgesRemixNodeNoLabels over the journeys, such as <Badge> elements reading "Cheapest" or "Fastest".
actionRemixNodeNoThe select link or submit button, at the price's end.
featuredbooleanNoRings the row in the brand colour, for the option a page recommends.
detailsRemixNodeNoFull detail under the row, such as a FlightItinerary per journey.
childrenRemixNodeYesThe FlightOption.Journey lines, one per direction.

Also accepts everything in TagProps<"article">.

FlightOption.Journey

PropTypeRequiredDescription
airlineRemixNodeYesThe airline or airlines, such as "Larkwing Air".
markRemixNodeNoThe airline's mark, drawn in a 1.75rem square before the route.

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

Also accepts everything in RouteProps.

Types

NameValuesWhat it decides
RouteProps"departure" | "arrival" | "duration" | "stops" | "stopsLabel" | "dayOffset" | "dayOffsetLabel"The route's ends and what lies between them; see FlightRoute.
@sdxc/ui

Can’t find it? Contact us