Skip to main content

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.

Base
Mantine + override
Mantine
Import
{ Pill } from '@mantine/core'
Source
src/themes/component-overrides/feedback.ts
src/themes/style-overrides/pill.module.css

Usage​

Oslo
variant
size
sm
md
withRemoveButton
React
<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.

UtkastAktivVenterTil vurderingFerdigAvvistArkivert
React
<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>
VariantLook
blueblue-1 background, blue-5 border, blue-7 text
yellowyellow-1 background, yellow-5 border, yellow-8 text
orangeorange-1 background, orange-4 border, orange-8 text
greengreen-1 background, green-4 border, green-7 text
redred-1 background, red-5 border, red-7 text
purplepurple-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.

PropertyTypeAllowed valuesDefaultDescription
sizeMantineSizexs · sm · md · lg · xlsmSets the height — 20, 24, 32, 40 or 48px. Only sm and md are used in this design system.
variantstringblue · 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.