# FlightOption

> One row of flight search results: badges such as "Cheapest", a line per journey with its airline and route, and the price with a select action.

```ts
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.

## Examples

```tsx
<FlightOption price="$412" priceDetail="Round trip" badges={<Badge>Cheapest</Badge>} action={<Button>Select</Button>}>
	<FlightOption.Journey airline="Larkwing Air" departure={{ time: "08:40", code: "MRW" }}
		arrival={{ time: "10:55", code: "VLS" }} duration="2h 15m" stopsLabel="Nonstop" />
</FlightOption>
```

## Props

| Prop | Type | Description |
| --- | --- | --- |
| `price` | `RemixNode` | The fare, formatted by the caller, such as "$412". |
| `priceDetail?` | `RemixNode` | What the fare covers, such as "Round trip per person", under the price. |
| `badges?` | `RemixNode` | Labels over the journeys, such as `<Badge>` elements reading "Cheapest" or "Fastest". |
| `action?` | `RemixNode` | The select link or submit button, at the price's end. |
| `featured?` | `boolean` | Rings the row in the brand colour, for the option a page recommends. |
| `details?` | `RemixNode` | Full detail under the row, such as a `FlightItinerary` per journey. |
| `children` | `RemixNode` | The FlightOption.Journey lines, one per direction. |

Also accepts everything in `TagProps<"article">`.


### FlightOption.Journey

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

| Prop | Type | Description |
| --- | --- | --- |
| `airline` | `RemixNode` | The airline or airlines, such as "Larkwing Air". |
| `mark?` | `RemixNode` | The 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

| Name | Values | What it decides |
| --- | --- | --- |
| `RouteProps` | `"departure" \| "arrival" \| "duration" \| "stops" \| "stopsLabel" \| "dayOffset" \| "dayOffsetLabel"` | The route's ends and what lies between them; see FlightRoute. |
