Pill
A Pill is a compact UI element used to display selected values, tags, or labels. It helps users identify and manage items, such as selected filters, categories, or users, and can optionally include a remove button.
Usage
<Pill size="sm">Oslo</Pill>
We use two sizes, sm and md. Without a colour variant, a pill is flat grey with a
border.
Variants
Six colour variants, named by hue. A colour carries no fixed meaning — pick the one that fits the context.
<Pill>Utkast</Pill>
<Pill variant="blue">Aktiv</Pill>
<Pill variant="yellow">Venter</Pill>
<Pill variant="orange">Til vurdering</Pill>
<Pill variant="green">Ferdig</Pill>
<Pill variant="red">Avvist</Pill>
<Pill variant="purple">Arkivert</Pill>
| Variant | Look |
|---|---|
blue | blue-1 background, blue-5 border, blue-7 text |
yellow | yellow-1 background, yellow-5 border, yellow-8 text |
orange | orange-1 background, orange-4 border, orange-8 text |
green | green-1 background, green-4 border, green-7 text |
red | red-1 background, red-5 border, red-7 text |
purple | purple-1 background, purple-5 border, purple-7 text |
In dark mode the background is the hue at 20% opacity and the text is white.
Props
Only what this design system changes. Everything else is Mantine's — read the full props table there.
| Property | Type | Allowed values | Default | Description |
|---|---|---|---|---|
size | MantineSize | xs · sm · md · lg · xl | sm | Sets the height — 20, 24, 32, 40 or 48px. Only sm and md are used in this design system. |
variant | string | blue · yellow · orange · green · red · purple | — | Selects a colour tint. These six are additions on top of Mantine's own default and contrast. |
Accessibility
The remove button is hidden from screen readers and skipped by the keyboard. A
standalone pill with a remove button needs its own keyboard path: either pass
removeButtonProps={{ tabIndex: 0, 'aria-hidden': false, 'aria-label': 'Fjern Oslo' }},
or offer removal elsewhere. See Accessibility.