# Price

A price with an optional billing period, a crossed-out old price and a savings badge.

- Category: Commerce
- Page: https://wunderui.com/components/price
- Tier: Core and Pro

## Install

Price ships with WunderUI Core and Pro in the @wunderui/react package.

## Import

```tsx
import { Price, PriceProps } from "@wunderui/react"
```

## Minimal usage

Then use it:

```tsx
import { Price } from "@wunderui/react"

export function PlanPrice() {
  return <Price amount="$39" period="/ seat / month" />
}
```

Expected result: You should see $39 in large bold type with the grey note / seat / month beside it on the same baseline.

## When to use

### Use Price for

- A plan price with its billing period on a pricing card, a paywall or a plan picker
- A sale price on a product card, with the old price crossed out and the saving beside it
- Prices in an order summary, a cart or a list, where the sizes have to match

### Use something else

- [Number Value](https://wunderui.com/components/number-value) for a headline figure with a caret and its change
- [Trend Chip](https://wunderui.com/components/trend-chip) for only a change in a percentage, as a small pill
- [Badge](https://wunderui.com/components/badge) for a short label or status without an amount

## Behavior

What the component renders and how it reads.

- **Static:** Price is not interactive: no focus, no hover state, no state of its own, no handlers. Wrap it in your own link or button where the price should open something.
- **Parts:** Only the amount is required. Period, old price and badge render only when you pass them, in that order, and Figma's plan, sale and sale badge types come from which you set.
- **Size:** The size is small, medium or large; without one, a price with a period is large and any other is small. The amount is 14, 24 or 36 px; period and old price are 12 px, or 14 px at medium.
- **Wrapping:** The row wraps when the column is too narrow: period, old price and badge move to the next line with 4 px between lines, and nothing is cut off. Add a no-wrap class to keep one line.
- **Strings:** Every part takes any node, usually a string. Nothing is formatted, shortened or translated: write the currency sign, separators and period note you want, in English format.
- **Digits:** Digits are proportional by default. Tabular numbers on the row apply to every part, because the setting is inherited.
- **Old price:** The old price is a strikethrough element. The strikethrough is visual and screen readers do not all announce it, so put a hidden Was in front of the figure.
- **Dark mode:** It uses the theme tokens for text and the red badge, so it follows the theme.
- **Motion:** None. The price does not animate when a value changes.
- **Reduced motion:** There is no motion, so reduced motion changes nothing.

## Anatomy

- `Price`: A row on one baseline with 8 px between the parts, wrapping with 4 px between lines when the column is narrow. It is not interactive: you pass finished strings.
- `Amount`: The amount in the foreground colour: 14 px semibold at small, 24 px bold at medium, 36 px bold with tight tracking at large.
- `Period`: The period after the amount, in tertiary text at 12 px (14 px at medium), such as / month or / seat / month.
- `Old price`: The compare-at value struck through, in tertiary text at the same size as the period.
- `Savings badge`: A small red pill with the badge text, such as Save 18%. It is centred on the row, not on the baseline.

## Best practices

### Do

- Pass the amount as a finished string with its currency sign and English separators, such as $1,842.50. The component does not format numbers.
- Set the size explicitly in lists and grids. Without it a price with a period is large and any other price is small, so a plan card and a product row can differ by accident.
- Use tabular numbers where prices stand in a column or change while people watch, so digits keep their width and decimal points line up.
- Put a hidden word such as Was in front of the old price. The strikethrough is visual only, and a screen reader may read the old price as a second price.

### Don't

- Don't pass an old price without a lower amount, or a badge that says something other than the saving. The old price and badge must agree with the figure beside them.
- Don't build price text by hand in cards. A hand-made row loses the shared sizes, the baseline and the wrapping.
- Don't use it for a figure with a change over time. For a KPI with a rising or falling arrow use Number Value.

## API reference

### Price

| Prop | Type | Default | Description |
|---|---|---|---|
| amount* | ReactNode |  | The price as a finished string with its currency sign, for example `$39` or `$1,842.50`. It is not formatted for you. |
| badge | ReactNode |  | The savings badge, a small red pill, for example `Save 18%`. |
| className | string |  | Extra classes for the row, merged after its own. Use them for `tabular-nums`, `flex-nowrap` or `justify-end`. |
| compareAt | ReactNode |  | The old price, shown struck through after the period. Pass it with a lower `amount` for a sale. |
| period | ReactNode |  | The text after the amount, such as `/ month` or `/ seat / month`. It also makes the default size large. |
| size | "sm" \| "md" \| "lg" | period ? "lg" : "sm" | The size of the amount: 14, 24 or 36 px. The other parts stay small beside it. |

## Examples

### Type: a plan price, a sale price or a sale price with a badge

### Size: small, medium or large

### Amount: dollars, euros or pounds with English separators

### Period: per month, per seat or per year

### Width: a price in a column of 420, 240 or 160 px

## In context

### Product card: a sale price in three currencies

The old price is read as Was, so the crossed-out number is not heard as a second price. The old price and badge move below the amount when the card is narrow.

### Plan cards: the price per seat for monthly or yearly billing

Yearly billing adds the old price and the saving to each plan. The price wraps inside the card, so the period is never squeezed.

### Order summary: amounts in one column

Small prices with tabular digits keep the decimal points under each other, and the total is a medium price.

## For AI agents

`get_component("price")`

Hand your agent this page as Markdown or the WunderUI MCP server, not a screenshot.
