Skip to contentWolf-Rayet

Lozenge

A lozenge shows an item's status so people can recognise it quickly.

Install

One package and one stylesheet. The stylesheet holds the tokens every component uses.

pnpm add @wolf-rayet/react
import '@wolf-rayet/react/css/wolf-rayet.css';
import { Lozenge } from '@wolf-rayet/react';

Props

A required prop is marked with an asterisk.

PropTypeDefaultDescription
children *ReactNodeNoneThe status. One or two words, in sentence case.
appearance'default' | 'inprogress' | 'success' | 'removed' | 'moved' | 'new' | 'lime' | 'yellow' | 'teal' | 'magenta''default'Picks the colour. The first six carry a meaning and should be matched to the status. The last four are colours with no meaning attached, for statuses of your own.

Accessibility

What the component does for you, and what it needs from you.

  • The text must name the state without relying on colour. Colour can support the meaning but must never be the only way to show it.
  • A lozenge cannot be focused and has no keyboard interaction, because it is a label, not a control.
  • Every appearance pair was measured for contrast in both themes.