# FareOptions

> Fare classes as cards in a `<fieldset>`, each a native radio sharing one `name`, so the choice posts with its form and needs no script.

```ts
import { FareOptions } from "@sdxc/ui/travel";
```

Renders the group: a `<fieldset>` named by its `<legend>`, with its cards stacked under 36rem
and side by side, equal width, from there. Arrow keys move between the cards and the chosen
one posts its `value` under `name`, both native radio behaviour.

## Examples

```tsx
<FareOptions legend="Choose your fare" name="fare" statusLabels={{ yes: "Included", no: "Not included", fee: "For a fee" }}>
	<FareOptions.Option value="basic" title="Basic" price="$412" features={[{ label: "Carry-on bag", included: "fee" }]} />
	<FareOptions.Option value="standard" title="Standard" price="$468" ribbon="Recommended" checked />
</FareOptions>
```

## Props

| Prop | Type | Description |
| --- | --- | --- |
| `legend` | `RemixNode` | What the choice is, such as "Choose your fare"; it names the group. |
| `hideLegend?` | `boolean` | Hides the legend visually while it still names the group. |
| `name` | `string` | The radio name every card shares; the chosen card's `value` posts under it. |
| `statusLabels` | `StatusLabels` |  |
| `children` | `RemixNode` | The FareOptions.Option cards. |

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


### FareOptions.Option

Renders one fare as a `<label>` card around its radio: the title and the radio, the price, then the feature list.

| Prop | Type | Description |
| --- | --- | --- |
| `value` | `string` | What the form posts when this fare is chosen, such as "standard". |
| `title` | `RemixNode` | The fare's name, such as "Standard"; it names the radio. |
| `price` | `RemixNode` | The fare's price, formatted by the caller, such as "$468". |
| `priceDetail?` | `RemixNode` | What the price covers, or the difference from the cheapest fare, such as "+$56". |
| `features?` | `Feature[]` |  |
| `ribbon?` | `RemixNode` | A ribbon over the card, such as "Recommended". |
| `checked?` | `boolean` | Starts chosen. |
| `disabled?` | `boolean` |  |
| `required?` | `boolean` | Makes a choice required before the form submits; set it on one card of the group. |

Also accepts everything in `Omit<TagProps<"label">, "children" | "title">`.


## Types

| Name | Values | What it decides |
| --- | --- | --- |
| `Included` | `"yes" \| "no" \| "fee"` | Whether a fare includes a feature, leaves it out, or offers it for a fee. |
