---
title: "Price"
description: "Shows a price with its currency, cents, period, and the old price before a discount. Use it in a line of text or as the large price of a pricing card."
url: https://gelatinui.com/components/price
markdown_url: https://gelatinui.com/components/price.md
access: free
install: "npx shadcn@latest add @gelatin-ui/price"
registry_item: https://gelatinui.com/r/price.json
version: "2026-11-09"
index: https://gelatinui.com/llms.txt
docs_index: https://gelatinui.com/docs/llms.txt
---

# Price

> Shows a price with its currency, cents, period, and the old price before a discount. Use it in a line of text or as the large price of a pricing card.

Page: https://gelatinui.com/components/price

## When to use it

Best for: A price with its currency, its minor part, its period, and the price before a discount.

- Use `variant="display"` on a plan.
- Use `PriceWas` for a discount: it is a `del`.
- Set the size on the root, and size a part in `em`.

## When not to use it

- For a number that is not money, use [Number Text](https://gelatinui.com/components/number-text.md).

## Notes for agents

- It reads the locale from `DisplayLocaleProvider`, or pass `locale` and `currency`.
- `animated` on `PriceValue` rolls the digits on a change.
- `free` and `from` on `PriceValue` show the words of `labels` on `Price` (default "Free" and "From").
- Put a `PriceEmpty` part in `PriceValue` for the words of no price. Default "—".
- A price is text: it has no hover and no focus.
- `minorDigits="always"` keeps `.00` on a whole price.

## Anatomy

```text
Price
├─ PriceValue (0..n)
├─ PricePeriod (0..n)
├─ PriceWas (0..n)
├─ PriceNote (0..n)
└─ PriceEmpty (0..n)
```

## API reference

### Price

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `variant` | `PriceVariant` | "inline" | `inline` (default): the price in a line of text ("$27.99 / month"). `display`: a pricing card price, the currency and the minor part small and high ("$79⁵⁰"), the period under the minor part. |
| `was` | `PriceWasPlacement` | "before" | Where `PriceWas` goes: `before` (default), in the line before the price; `below`, on a line of its own under the price, with what follows it ("$183 $107.40 billed yearly"). |
| `currency` | `string` |  | The ISO 4217 code of every value inside. Default `"USD"`. It sets the minor digits (0 for JPY). |
| `locale` | `string` |  | The BCP 47 locale. Default: the `DisplayLocaleProvider` locale, else `"en-US"`. |
| `minorDigits` | `"always" \| "auto"` |  | `auto` (default): "$49", "$49.50". `always`: the minor digits on every value ("$49.00"). |
| `labels` | `Partial<PriceLabels>` |  | The words (`PriceLabels`): "Free" and "From". Keep the object stable. |

### PriceValue

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `value` | `number \| null` |  | The price. `null`, `undefined`, and `NaN` show the empty text. |
| `end` | `number \| null` |  | The end of a range ("$10–20"): `Intl` writes the shared parts once. A range never rolls. |
| `free` | `boolean` | false | A price of 0 writes the `free` word of the Price `labels` ("Free"). Default `false`: "$0". |
| `from` | `boolean` | false | The `from` word of the Price `labels` before the price, for "at least" ("From $49"). |
| `compact` | `boolean` | false | `$1.2M` from 10,000 (the `compactCurrency` kind). |
| `animated` | `boolean` | false | Rolls the digits on a change (the Rolling Number), on the `panel` clock. Default `false`. |
| `children` | `ReactNode` |  | A `PriceEmpty` part: the words of no price. With a price, they are not drawn. |

### PricePeriod

No props of its own: `className`, `children`, and every other prop go to the element it renders.

### PriceWas

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `value` | `number \| null` |  | The price before the discount. `null`, `undefined`, and `NaN` render nothing. |
| `compact` | `boolean` | false | `$1.2M` from 10,000 (the `compactCurrency` kind). |

### PriceNote

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `rounded` | `"default" \| "full"` |  |  |
| `size` | `"default" \| "lg"` |  |  |
| `variant` | `"dashed" \| "default" \| "destructive" \| "ghost" \| "info" \| "link" \| "media" \| "outline" \| "secondary" \| "success" \| "warning"` | "success" |  |

Also takes every prop of Base UI `UseRender`: https://base-ui.com/react/components/use-render

### PriceEmpty

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `data-slot` | `string` |  | The `data-slot` of the root: the item's own slot (`"time-ago"`). Default `"empty-value"`. |

Also takes every prop of Base UI `UseRender`: https://base-ui.com/react/components/use-render

## Styling

| Part | Slot | States | CSS variables | Tokens |
| --- | --- | --- | --- | --- |
| Price | `price` |  |  |  |
| PriceValue | `price-value` |  |  |  |
| PricePeriod | `price-period` |  |  |  |
| PriceWas | `price-was` |  |  |  |
| PriceNote | `price-note` |  |  |  |
| PriceEmpty | `price-empty` |  |  |  |

## Usage

Compose the value and the period.

```tsx title="plan-price.tsx"
import { Price, PricePeriod, PriceValue } from "@/components/ui/price";

export function PlanPrice() {
  return (
    <Price variant="display" className="text-[56px]">
      <PriceValue value={79.5} />
      <PricePeriod>/mo</PricePeriod>
    </Price>
  );
}
```

## Compose

Rules:

- Compose the parts (`compose-parts`): Build each item from its named parts as children, and pass your text and icons in as parts.
- Every state is designed (`every-state`): Give each view of data its loading, empty, and error states: a skeleton in the final layout, an `Empty` with an illustration and one next action, and an error that says what failed and how to retry.

## Add it

```bash
npx shadcn@latest add @gelatin-ui/price
```

It adds 27 registry items: 24 files, 5233 lines, and the npm packages `@base-ui/react`, `clsx`, `motion`, `tailwind-merge`, `tailwind-variants`.

## Built on

- [Badge](https://gelatinui.com/components/badge.md)
- [Rolling Number](https://gelatinui.com/components/rolling-number.md)

## For AI agents

- Every item, one file: https://gelatinui.com/llms.txt
- MCP server (`search_items`, `get_item`, `get_install_plan`): https://gelatinui.com/mcp

## Related

- [Number Text](https://gelatinui.com/components/number-text.md)
- [Segmented Control](https://gelatinui.com/components/segmented-control.md)

## Accessibility

The old price is a `del`, so a screen reader can say it was removed.

The value is real text.

## Motion

| Part | Motion |
| --- | --- |
| Value | none · with `animated`, the digits roll on a change |
