# Price

> A product's price as a shop shows it: the amount, an optional "From" before it, the compare-at price struck through with how much is saved, and the cost of each instalment.

```ts
import { Price } from "@sdxc/ui/commerce";
```

Renders the price. A compare-at price at or below `amount` is ignored, so a stale sale
price never shows a negative saving.

## Examples

```tsx
<Price amount={4500} currency="USD" compareAt={6000} />
```

```tsx
<Price amount={2900} currency="EUR" locale="de-DE" from installments={4} />
```

## Props

| Prop | Type | Description |
| --- | --- | --- |
| `amount` | `number` | The price in the currency's minor units. |
| `currency` | `string` | The ISO 4217 code, such as `USD`. |
| `locale?` | `string` |  |
| `compareAt?` | `number` | The earlier price in minor units; drawn struck through only when above `amount`. |
| `from?` | `boolean` | Marks `amount` as the lowest of several prices, such as the smallest size. |
| `installments?` | `number` | Splits the price into this many payments; a line shows the first share when 2 or more. |
| `size?` | `"sm" \| "md" \| "lg"` |  |
| `labels?` | `Partial<Labels>` |  |
| `inline?` | `boolean` | Draws the price as a `<span>`, for a price inside a line of text. @default false |
| `id?` | `string` |  |

