Server Component · 0 KB client JS

Badge

A small status label in the standard variant and color-scheme families.

ActivePendingFailedBetaDefault

Import#

import { Badge } from "astralis-ui";

Variants and sizes#

variants
solidsubtlesurfaceoutline
sizes
xssmmdlg

Badge or Tag?#

The two render nearly the same chip (Badge is pill-shaped, Tag is rounded), so the radius won't tell you which to reach for. The meaning does:

  • Badge is a state the thing is in: Active, Beta, Failed, 3 unread. Read-only, which is why it has no close button and no group.
  • Tag is a label the thing carries: a topic, a category, a filter. That's why it can be removed, selected and grouped.

Pick by meaning, not by shape: a reader who sees Badge should know the chip describes status without having to check what it says. For counts anchored to a corner, combine a Badge with Float.

Props#

PropTypeDefaultDescription
variant"solid" | "subtle" | "surface" | "outline""subtle"Visual style. surface is the bordered sibling of subtle.
colorSchemeall 15 schemes"gray"Hue the badge paints with, via the accent channel.
size"xs" | "sm" | "md" | "lg""sm"Text and padding scale.