PackageSavings
A bundle's price beside what its parts cost apart.
Flight + Hotel + Car
- Return flights MRW ⇄ VLSLarkwing Air · EconomyBooked separately:
$684 - 5 nights at Hotel SaltmarshDouble room · breakfastBooked separately:
$824 - Compact car, 5 daysTallow RentBooked separately:
$190
Package priceYou save $212
Booked separately: $1,698
View code
<PackageSavings
title="Flight + Hotel + Car"
savings="You save $212"
bundleLabel="Package price"
bundlePrice="$1,486"
bundleDetail="2 travellers · taxes included"
separateTotal="$1,698"
separateLabel="Booked separately"
action={<Button>Book package</Button>}
>
<PackageSavings.Part kind="flight" label="Return flights MRW ⇄ VLS" detail="Larkwing Air · Economy" price="$684" />
<PackageSavings.Part kind="stay" label="5 nights at Hotel Saltmarsh" detail="Double room · breakfast" price="$824" />
<PackageSavings.Part kind="car" label="Compact car, 5 days" detail="Tallow Rent" price="$190" />
</PackageSavings>Installation
An ordinary dependency: install it, import the theme once, and import the component where it is used.
npm add @sdxc/ui remiximport "@sdxc/ui/theme.css";Usage
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.
Composition
The parts the component publishes, each a static property of the host.
PackageSavingsPackageSavings.PartRenders 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'sseparateLabelwhen set.
Props
Read from the component's own types, so every prop, every default and every allowed value is listed.
| Prop | Type | Required | Description |
|---|---|---|---|
title | RemixNode | No | What the bundle is, such as "Flight + Hotel + Car", over the parts. |
savings | RemixNode | Yes | The saving as a badge, such as "You save $212". |
bundleLabel | RemixNode | Yes | What the bundled price is, such as "Package price". |
bundlePrice | string | Yes | The bundled price, formatted, such as "$1,486". |
bundleDetail | RemixNode | No | What the price covers, such as "2 travellers · taxes included", under it. |
separateTotal | string | No | The parts' prices added up, struck through above the bundled price, such as "$1,698". |
separateLabel | string | No | Read before every struck price, such as "Booked separately", since a strike-through is silent to most screen readers. |
action | RemixNode | No | A booking button or link under the bundled price. |
children | RemixNode | Yes | The PackageSavings.Part lines. |
Also accepts everything in Omit<TagProps<"section">, "title">.
PackageSavings.Part
| Prop | Type | Required | Description |
|---|---|---|---|
kind | "flight" | "stay" | "car" | "activity" | Yes | |
icon | RemixNode | No | A glyph in place of the kind's own. |
label | RemixNode | Yes | What the part is, such as "Return flights MRW ⇄ VLS". |
detail | RemixNode | No | A second line, such as "Larkwing Air · Economy". |
price | string | Yes | 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. |