# Pill

A short label on the base surface, such as "Økologisk" on a product image.

Code: `components/ui/pill.tsx`. Figma: Pill, node 2124:1130. Live: https://design.id-hub.dk/components/pill

```tsx
import { Pill } from '@/components/ui/pill';

<Pill>Økologisk</Pill>
<Pill size="sm">Økologisk</Pill>
```

| Prop | Type | Default | What it does |
| --- | --- | --- | --- |
| size | `'md' \| 'sm'` | `'md'` | Medium is 28 px high with Body/md. Small is 22 px high with Body/sm. |
| children (required) | `ReactNode` |  | The label. A word or two. |

Do:
- Use it on a product image or a coloured ground, where the white of the pill stands out.
- Keep the label to a word or two.
- Pass it to ProductCard with the pills prop.

Do not:
- Do not invent the fact on a pill. "Økologisk" comes from the product data, with the certificate behind it.
- Do not use it as a button or a filter. It does nothing when pressed.
- Do not colour it. It is the base surface with the text colour.

Accessibility:
- Plain text: a screen reader reads the label where it stands.
- On a white page a pill has no edge. Put it on an image or a ground.

Tokens it uses:
- color.surface.base
- color.text.default
- radius.sm
- type.body.md
- type.body.sm
- component.pill.padding-x
- component.pill.padding-y
- component.pill.small-padding-x
- component.pill.small-padding-y

---

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.
