Skip to main content
Copy for LLM

Badge

A compact label for status, counts, or categorization. Badges are pill-shaped by default and come in seven semantic intents.

Live Sandbox

This is a hydrated playground for the component. Toggle "Live preview" on the block below to swap the static HTML render for a real Livewire instance — every prop in the component's sandbox schema becomes an editable form field inside the iframe, so you can try different prop combinations live without writing any local code.

Sandbox
Beta

Basic Usage

Variants
Primary Accent Success Warning Danger Info Neutral

Sizes

Sizes
Small Medium Large

Surfaces

The surface prop changes how the intent color is applied. soft (default) is the tinted chip; solid fills with the intent color and uses an on-color foreground; outline is transparent with an intent-colored ring. All three read the same semantic intent tokens, so they restyle automatically under any theme.

Every surface in every intent
surface by intent
primarysuccesswarningdangerneutral
soft Beta Beta Beta Beta Beta
solid Beta Beta Beta Beta Beta
outline Beta Beta Beta Beta Beta

A neutral badge on the soft surface fills with the text color mixed into the surface it stands on, as a neutral button does: light on the page and on a card, darker on a card footer, a muted area, a striped or selected row of a table or a data table and an entry of a menu under the pointer, and lighter in a dark panel, so it does not vanish into the surface around it. A gray area of your own follows the same way, as A gray surface of your own shows.

With Dot Indicator

Use the dot prop to add a small colored dot to the left of the label. Useful for status indicators.

Status dots
Online Away Offline Idle

With Icons

Badges accept any content, including icons:

Badges with leading icons
Verified Pending Rejected Info

Width & Layout

Badges are inline elements that auto-size to their text content. They naturally flow within text or alongside other elements. By default a badge is a single-line, fixed-height pill — its text never wraps.

Multi-line labels

For a long label in a narrow space (a taxonomy chip in a table cell), set wrap. In wrap mode the badge swaps its fixed height for a minimum height plus vertical padding, so the pill grows with the wrapped text instead of the second line spilling below the surface. Without wrap, forcing white-space: normal alone leaves the extra lines outside the pill.

A wrapping badge grows to fit its label
Religious founders & spiritual teachers

Tooltip & Leading Icon

tooltip surfaces a supplementary explanation through WireKit's own Tooltip component — it appears on hover, focus, touch, and keyboard, and is announced to screen readers via aria-describedby (the badge label stays the accessible name). leadingIcon renders a decorative status glyph before the label. Every badge also carries a subtle depth shadow so it reads less flat.

Badge with tooltip + leading icon
Live
Pending
Failed

Trailing Icon & Dismissible

trailingIcon mirrors leadingIcon but renders after the label (handy for a link arrow). dismissible adds a keyboard-operable close button that removes the badge and dispatches a wirekit:badge-dismissed event — useful for removable filter chips. The button is named after the badge it removes, "Remove Design" for a badge that reads Design, so a row of chips does not read as a row of buttons called "Remove". Override the name with dismissLabel.

Trailing icon + dismissible chips
Read more Design Engineering

Props

Prop Type Default Description
intent string 'neutral' Semantic intent: primary, accent, neutral, success, warning, danger, info
size string 'md' sm, md, lg
surface string 'soft' soft (tinted chip), solid (filled + on-color text), or outline (transparent + ring). outlined is accepted as an alias of outline
dot bool false Shows a small colored dot before the label
tooltip string|null null Supplementary explanation, surfaced through the WireKit Tooltip component (hover / focus / touch / keyboard)
leadingIcon string|null null Decorative status glyph rendered before the label (icon alias, e.g. check / clock)
trailingIcon string|null null Decorative glyph rendered after the label (icon alias, e.g. arrow-right)
dismissible bool false Renders a keyboard-operable close button that removes the badge and dispatches wirekit:badge-dismissed
dismissLabel string|null null Accessible name for the dismiss button. Defaults to the translated "Remove" followed by the badge's text, such as "Remove Design", and to "Remove" alone on a badge without text.
wrap bool false Multi-line mode — a long label wraps and the pill grows (min-height + padding) instead of clipping the second line
scope string|null null Scoped personalization name

Accessibility

  • Badges render as <span> elements — inline by default
  • The dot indicator has aria-hidden="true" (decorative — its color is the only signal, which is already expressed via the text intent)
  • For status badges that convey meaning beyond their color, ensure the text label describes the state clearly (e.g. "Online", "Error", "Expired")

Keyboard Interaction

With dismissible, the badge renders a real <button>: it takes Tab focus, shows the focus ring, and Enter / Space dismiss it. The focus then moves to the next control, which in a row of dismissible badges is the next badge's close button. Without it there is no interactive element and nothing to focus.

Pitfalls

  • Don't put interactive content inside a badge. Badges are inline <span> elements — for clickable status pills wrap them with a <x-wirekit::link> or use <x-wirekit::button size="sm" intent="..." />.

Design Tokens

Badges use tinted backgrounds via CSS color-mix() for a subtle, theme-aware look. All colors derive from semantic tokens:

Intent Background Text Border
primary --color-wk-accent (12% mix) --color-wk-accent-content --color-wk-accent (25%)
accent --color-wk-accent (solid) --color-wk-accent-fg --color-wk-accent
success --color-wk-success (12% mix) --color-wk-success-text --color-wk-success (25%)
warning --color-wk-warning (12% mix) --color-wk-warning-text --color-wk-warning (25%)
danger --color-wk-danger (12% mix) --color-wk-danger-text --color-wk-danger (25%)
info --color-wk-info-tone (8% mix) --color-wk-info-text --color-wk-info-tone (20%)
neutral --color-wk-bg-soft, the text color mixed into the surface it stands on --color-wk-text --color-wk-border-subtle

All intents automatically adapt to light/dark mode via the underlying tokens.

Customization

Override defaults without publishing views via config/wirekit.php:

'components' => [
    'badge' => ['intent' => 'primary', 'size' => 'lg'],
],

Or merge custom classes inline:

<x-wirekit::badge class="uppercase tracking-wider">Beta</x-wirekit::badge>

Usage & Conventions

Prop conventions — this component uses one or more of the shared semantic prop names (intent / variant / tone / surface). See Prop naming conventions for the canonical vocabulary, alias matrix, and decision tree.

Further Reading

Updated in WireKit v2.66.0 (2026-10-13)

Was this page helpful?

Thank you for your feedback!

Voting requires cookies or local storage. What we store