# ProductCard

> A product in a shop's grid: its picture at a fixed ratio, the title, a subtitle, the price and the colours it comes in.

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

Renders the card. The title link's `::after` fills the article, so a click anywhere opens
the product, and `badges` and `action` sit on a layer above it to stay reachable.

## Examples

```tsx
<ProductCard href="/posters/dune" title="Dune at dusk" subtitle="Ana Ortiz" media={<img src="/dune.jpg" alt="" />} price={<Price amount={4500} currency="USD" />} swatches={[{ name: "Oak", color: "#b58a5a" }]} />
```

## Props

| Prop | Type | Description |
| --- | --- | --- |
| `href` | `string` | The product's page; the title links there and the link covers the card. |
| `title` | `RemixNode` |  |
| `subtitle?` | `RemixNode` | A line under the title, such as the artist or the material. |
| `media` | `RemixNode` |  |
| `hoverMedia?` | `RemixNode` | A second picture the card crossfades to on hover and focus, such as the poster framed. |
| `mediaBackground?` | `string` | The colour behind the picture. |
| `ratio?` | `string` | The picture's aspect ratio. @default "4 / 5" |
| `price` | `RemixNode` | The price, such as a Price. |
| `badges?` | `RemixNode` | Tags over the picture's top-start corner, such as "New" or "Sale". |
| `swatches?` | `Swatch[]` | The colours the product comes in; five dots show, then "+N". |
| `swatchesLabel?` | `string` | The swatch list's accessible name. @default "Colours" |
| `action?` | `RemixNode` | A control over the picture's top-end corner, such as a wishlist form; it stays clickable. |
| `headingLevel?` | `2 \| 3 \| 4` | The title's heading level. @default 3 |

Also accepts everything in `Omit<TagProps<"article">, "children" | "title">`.

