Skip to content

Badge

CSS

A badge is a short label. Status, a count, a category. Stick one next to a heading or in a table cell. If something just happened on the page, that’s a banner, not a badge.

Put .k-badge on a span. A div works too. A variant picks the color. A style picks the fill: solid if you skip one, then outline, dash, soft, or ghost. Mix them. k-badge--info k-badge--soft is a washed info chip.

Sizes go --xs to --xl. Skip the size and you get 1.5rem. An empty badge, no text and no icon, collapses to a dot. Drop a kit icon in when the color isn’t enough on its own.

ClassTypeDescription
k-badgecomponentThe chip itself. Goes on a span or a div. Empty collapses to a dot.
k-badge--primaryvariantOrange kit chrome.
k-badge--secondaryvariantMuted field color.
k-badge--accentvariantAccent color.
k-badge--infovariantNeutral status.
k-badge--successvariantPositive status.
k-badge--warningvariantStatus needing attention.
k-badge--dangervariantNegative status.
k-badge--outlinestyleTransparent with a solid border.
k-badge--dashstyleTransparent with a dashed border.
k-badge--softstyleVariant color washed into the surface.
k-badge--ghoststyleNo border, muted text.
k-badge--xsmodifier1rem tall.
k-badge--smmodifier1.25rem tall.
k-badge--lgmodifier1.75rem tall.
k-badge--xlmodifier2rem tall.

Variants without a style class. Filled is the default. Danger here also carries an icon.

DefaultPrimaryInfoSuccessWarning

Danger

<span class="k-badge">Default</span>
<span class="k-badge k-badge--primary">Primary</span>
<span class="k-badge k-badge--info">Info</span>
<span class="k-badge k-badge--success">Success</span>
<span class="k-badge k-badge--warning">Warning</span>
<span class="k-badge k-badge--danger">
<span class="k-icon k-icon--danger" aria-hidden="true"></span>
Danger
</span>

The same info color through every fill treatment.

FilledSoftOutlineDashGhost
<span class="k-badge k-badge--info">Filled</span>
<span class="k-badge k-badge--info k-badge--soft">Soft</span>
<span class="k-badge k-badge--info k-badge--outline">Outline</span>
<span class="k-badge k-badge--info k-badge--dash">Dash</span>
<span class="k-badge k-badge--info k-badge--ghost">Ghost</span>

This isn’t a live region. Leave role="alert" off. If the color means something, say it in the text, or hide the icon with aria-hidden="true" and keep the word. Empty dots are decorative. If the dot is the only status, give the badge an aria-label.

Do

  • Mix a color with a style when you want a wash or an outline.
  • Keep the text to a word or a count.

Don’t

  • Put role="alert" on it. Use a banner if something just happened.
  • Write a sentence in a badge.
  • Trust color alone to carry the meaning.