SearchCtrlK

  • ↑↓navigate
  • ↵open
  • escclose

Can’t find it? Contact us

PriceBreakdown

A receipt block as a <dl>.

4 nights$182 × 4 nights
$728.00
Cleaning fee
$45.00
Service fee
$61.10
Weekly stay discount
−$72.80
Total (USD)
$761.30

You won't be charged yet

View code
tsx
<PriceBreakdown note="You won't be charged yet">
	<PriceBreakdown.Line label="4 nights" detail="$182 × 4 nights" amount="$728.00" name="nights" />
	<PriceBreakdown.Line label="Cleaning fee" amount="$45.00" />
	<PriceBreakdown.Line label="Service fee" amount="$61.10" />
	<PriceBreakdown.Line label="Weekly stay discount" amount="$72.80" tone="discount" />
	<PriceBreakdown.Total label="Total (USD)" amount="$761.30" name="total" />
</PriceBreakdown>

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

Renders the receipt: a <dl> whose lines each pair a <dt> label with a <dd> amount, so the pairing survives in the accessibility tree, and the note centred beneath it.

Composition

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

  • PriceBreakdown
  • PriceBreakdown.LineRenders one charge: its label, the working under it in muted small type, and its amount at the end.
  • PriceBreakdown.TotalRenders the total: the same columns as a line, set bold and a step larger under a rule that closes off the charges above it.

Props

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

PropTypeRequiredDescription
noteRemixNodeNoSmall muted text under the total, such as "You won't be charged yet"; it sits after the <dl>, since a description list holds only label/value groups.

Also accepts everything in TagProps<"div">.

PriceBreakdown.Line

PropTypeRequiredDescription
detailRemixNodeNoHow the amount was worked out, such as "$182 × 4 nights", in small type beneath.
tone"default" | "discount"No

Also accepts everything in AmountProps.

PriceBreakdown.Total

Also accepts everything in AmountProps.

Types

NameValuesWhat it decides
Tone"default" | "discount""discount" colours the line green and signs its amount with a minus.
@sdxc/ui

Can’t find it? Contact us