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.
In Figma: Product Card (node 25:2701). In code: components/ui/product-card.tsx
Example
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}
/>Props
| 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. | |
expanded | 'hover' | 'always' | 'hover' | Hover shows price and colours on pointer hover and keyboard focus, as in Figma. Always is for touch screens. |
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 expanded="always" where there is no hover, such as on a phone.
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.
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-radius
- component.product-card.swatch-padding