# PackageSavings

> A bundle's price beside what its parts cost apart: a line per part (flight, stay, car) with its separate price struck through, then the bundled price large with a "You save" badge.

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

Renders the bundle: a `<section>` whose title and parts list sit over the bundled price under
32rem, and beside it from there. The parts total is struck through over the bundled price,
and the saving is a success-toned badge beside it.

## Examples

```tsx
<PackageSavings title="Flight + Hotel" savings="You save $212" bundleLabel="Package price"
	bundlePrice="$1,486" separateTotal="$1,698" separateLabel="Booked separately">
	<PackageSavings.Part kind="flight" label="Return flights MRW ⇄ VLS" price="$684" />
	<PackageSavings.Part kind="stay" label="5 nights at Hotel Saltmarsh" price="$1,014" />
</PackageSavings>
```

## Props

| Prop | Type | Description |
| --- | --- | --- |
| `title?` | `RemixNode` | What the bundle is, such as "Flight + Hotel + Car", over the parts. |
| `savings` | `RemixNode` | The saving as a badge, such as "You save $212". |
| `bundleLabel` | `RemixNode` | What the bundled price is, such as "Package price". |
| `bundlePrice` | `string` | The bundled price, formatted, such as "$1,486". |
| `bundleDetail?` | `RemixNode` | What the price covers, such as "2 travellers · taxes included", under it. |
| `separateTotal?` | `string` | The parts' prices added up, struck through above the bundled price, such as "$1,698". |
| `separateLabel?` | `string` | Read before every struck price, such as "Booked separately", since a strike-through is silent to most screen readers. |
| `action?` | `RemixNode` | A booking button or link under the bundled price. |
| `children` | `RemixNode` | The PackageSavings.Part lines. |

Also accepts everything in `Omit<TagProps<"section">, "title">`.


### PackageSavings.Part

Renders one part of the bundle: its icon in a tinted square, its label and detail, and what it costs alone struck through at the end, led by the bundle's `separateLabel` when set.

| Prop | Type | Description |
| --- | --- | --- |
| `kind` | `"flight" \| "stay" \| "car" \| "activity"` |  |
| `icon?` | `RemixNode` | A glyph in place of the kind's own. |
| `label` | `RemixNode` | What the part is, such as "Return flights MRW ⇄ VLS". |
| `detail?` | `RemixNode` | A second line, such as "Larkwing Air · Economy". |
| `price` | `string` | What the part costs booked alone, formatted, such as "$684"; drawn struck through. |

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


## Types

| Name | Values | What it decides |
| --- | --- | --- |
| `Kind` | `"flight" \| "stay" \| "car" \| "activity"` | What a part is, which picks its icon. |
