Skip to the content

Label

A short read-only text badge for a status, a category or metadata. Its background and ink come from the theme's semantic palette.
Data Display

When to use

Use when
  • Signalling the state of an entity: "New", "Pending", "Approved".
  • A category tag in cards and lists.
Avoid when
  • The user picks, removes or taps the item — use Chip.
  • An action — use Button.
  • Headings or running text — use Text.

Usage

defaultinfosuccesswarningdanger
import { Label } from '@apollion-dsi/core/elements/label';

<Label variant="success" text="Approved" />;

variant picks the palette: the light tone fills the badge and the action tone sets the ink. children wins over text.

Inverted

On dark or photographic surfaces the light fill disappears. inverted fills with the action tone and derives the ink by contrast (AA in any theme). To invert a whole subtree, use surface on the container (surface inversion).

defaultsuccessdanger
<Label inverted variant="success" text="Live" />

Status

status draws a small StatusDot before the text. The dot is decorative, so say the state in the text. It reads best on the default tonal fill. Status meanings: Chip › Status.

idleliverunningsync failed
<Label status="working" variant="info" text="running" />

Playground

loading

Accessibility

  • A Label is text: screen readers read it inline. Write the meaning in the text, not in the colour alone.
  • The status dot is aria-hidden.

Properties

Besides the props above, every component accepts the layout props (spacing, color, flex/grid, sizing, border) — not repeated here.

See also