# ProductCard

One product in a listing: the packshot on Snow with the article number and the name, and on hover or focus the colours and the price.

Code: `components/ui/product-card.tsx`. Figma: Product Card, node 25:2701. Live: https://design.id-hub.dk/components/product-card

```tsx
import { ProductCard } from '@/components/ui/product-card';

<ProductCard
  href="/produkter/0510"
  sku="0510"
  name="T-TIME® T-shirt"
  image={packshot}
  price="kr. 99,00"
  priceNote="(kr. 79,20 ex. moms)"
  swatches={colours}
  moreColours={13}
  pills={<Pill size="sm">Økologisk</Pill>}
/>
<ProductCard breakpoint="mobile" href="/produkter/0510" sku="0510" name="T-TIME® T-shirt" image={packshot} price="kr. 99,00" />
```

| Prop | Type | Default | What it does |
| --- | --- | --- | --- |
| href (required) | `string` |  | Where the card leads. The whole card is the link. |
| sku (required) | `string` |  | The article number, such as "0510". |
| name (required) | `string` |  | The product name. |
| image (required) | `string` |  | The packshot. Shown on Snow, multiplied, never cropped. |
| price | `string` |  | Already formatted, such as "kr. 99,00". Never computed in the card. |
| priceNote | `string` |  | Already formatted, such as "(kr. 79,20 ex. moms)". |
| swatches | `ProductCardSwatch[]` |  | { label, image } for the colours shown. |
| moreColours | `number` |  | How many more colours there are, shown as +13. |
| pills | `ReactNode` |  | Pills in the top corner of the image, such as <Pill>Økologisk</Pill>. |
| breakpoint | `'default' \| 'mobile'` | `'default'` | Default is the card for a pointer. Mobile is the card for a phone: the name and the price stand under the image, always, and there are no colours. |
| expanded | `'hover' \| 'always'` | `'hover'` | On the default card: hover shows price and colours on pointer hover and keyboard focus, as in Figma. Always keeps the panel open. |
| labels | `{ colours?: (count: number) => string }` |  | Texts read aloud. Pass translations here. |

Do:
- Lay cards out in a grid with the seam (2 px) between them: they are tiles of one block.
- Pass the price as the shop formats it. The card never calculates.
- Use breakpoint="mobile" on a phone, where there is no hover.
- Put a pill on the image only for a fact from the product data.

Do not:
- Do not put a packshot on any ground but Snow.
- Do not crop the packshot or give it a shadow.
- Do not invent a price, a name or an article number for a card.

Accessibility:
- The name is the link and covers the whole card.
- The price and the number of colours are read aloud once, also when the panel is closed.
- The article number is Charcoal on Snow, 6.58:1.

Tokens it uses:
- color.packshot.fill
- color.neutral.0
- color.neutral.200
- color.neutral.500
- color.neutral.900
- space.inline.1
- space.inline.3
- space.seam
- type.body.sm
- type.body.xs
- component.product-card.swatch-size
- component.product-card.swatch-padding
- radius.sm
- color.neutral.600
- color.text.muted
- color.text.default
- space.inline.1
- space.inline.2
- space.inline.4

---

Drawn in Figma: one of the 8 components that may be used anywhere, the public site included. All of them: https://design.id-hub.dk/components.md. Token values: https://design.id-hub.dk/tokens.md.

Index of everything, as text: https://design.id-hub.dk/llms.txt. Never invent a colour, a size, a component or a product fact: if it is not here, it does not exist yet.
