Skip to content
kitn AI/UI

Badge

kai-badge

Takes its content as plain light-DOM text, so the host page’s CSS still reaches it.

  • Shadow DOM
  • 3 variants
  • Light-DOM content
  • 1 part

Put the label or number as light-DOM text inside the element, then set variant to pick the look — a muted pill, a compact count, or a filled citation marker. The badge sizes to its content; place it wherever it belongs in your layout.

<kai-badge>Beta</kai-badge>
<kai-badge variant="count">3</kai-badge>
<kai-badge variant="citation">1</kai-badge>

A muted pill for labels and statuses.

count is a compact badge for unread counts and other small numbers.

citation is a filled primary marker for inline citation references.

SlotModePurpose
injectThe badge's label: text, or a small inline icon plus text.

Restyle the pill through its part — change the background, color, or shape; variant only sets the defaults.

PartPurposeExample
The badge pill. Restyle its background, color, or shape; the `variant` prop (default/count/citation) sets the defaults.
kai-badge::part(badge) { background: var(--color-primary); color: var(--color-primary-foreground) }
PropertyTypeDefaultNotes
theme'auto'Color mode (`auto` follows prefers-color-scheme).
variant'default'Badge style; `default` is the muted pill.

This element wraps these SolidJS components — reach for them directly when you need finer control than the props expose.

Badge