Skip to content

Feedback

Badge

A small label for statuses, counts, and tags.

stableNo JS requiredhydrateless/badge.css

A small label for statuses, counts, and tags. CSS-only.

Playground

Live
Active

Intents

Live
neutral primary danger success warning info

Props

The framework bindings expose these props (and forward the rest to the root element).

PropTypeDefaultDescription
intent'neutral' | 'primary' | 'danger' | 'success' | 'warning' | 'info''neutral'Color role.
variant'soft' | 'solid' | 'outline''soft'Fill style.
size'sm' | 'md''md'Badge size.

CSS variables

Override these on any ancestor to theme the component. See the theme studio to preview changes live.

CSS variableUsed for
--hl-primaryAccent for the chosen intent.
--hl-radius-fullPill corner radius.

Accessibility

  • A badge is decorative text; if it conveys status, include that meaning in nearby copy too.

Released under the MIT License.