Skip to content

Pill

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

In Figma: Pill (node 2124:1130). In code: components/ui/pill.tsx

Example

ØkologiskØkologisk
ØkologiskØkologisk
import { Pill } from '@/components/ui/pill';

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

Props

PropTypeDefaultWhat it does
size'md' | 'sm''md'Medium is 28 px high with Body/md. Small is 22 px high with Body/sm.
children (required)ReactNodeThe 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