Skip to content

Badge

Last updated 6 Nov 2026

NbBadge is a compact label used to highlight status, category, or a short value. Its variants name what it means (neutral, info, success, warning, danger, primary), and each paints a measured pair. Two sizes and an optional dot.

vue
<template>
  <NbBadge variant="info">badge</NbBadge>
</template>

Variants ​

variant says what the badge means, and the theme picks the colour. Each status intent paints the theme's status surface pair (--nb-c-<intent>-surface under --nb-c-on-<intent>-surface), so a badge, a banner and a toast that mean the same thing look the same. primary is the filled accent, for a badge that is not a status.

Badge text is 10px or 11px, so every pair is held to 4.5:1 with no large-text allowance, measured in tests/badgeContrast.test.ts:

VariantLightDark, worst to best plane
neutral10.245.26 to 9.35
info10.874.98 to 8.72
success8.045.87 to 10.48
warning8.075.77 to 10.36
danger10.284.84 to 8.37
primary7.604.71

In dark the status grounds are a 16% wash over whatever plane the badge sits on, which is why they have a range.

Colour still is not the only signal. A status badge carries a word, and dot or icon adds a second cue.

The colour names are deprecated ​

grey, blue, green, orange, red and purple still work. Each renders as the intent it was used for and warns once in development:

WasNow
greyneutral
blueinfo
greensuccess
orangewarning
reddanger
purpleprimary

The old washes measured 1.88:1 (orange) to 4.45:1 (blue) at this size in light. purple was a pale accent wash and now renders as the filled primary.

Sizes ​

With an icon ​

icon puts a glyph before the text, sized to the badge.

Content ​

  • A status badge uses one of the nine states in Status indicators: Draft, Pending, Running, Active, Attention, Paused, Failed, Inactive, Unknown. Map your product's words onto them.
  • One word, sentence case, no period. Type Active, never ACTIVE: the styling can set the case, the text cannot take it back.
  • Colour is never the only signal. The word carries the state, so two badges that differ only in colour are a bug.
  • A placeholder badge says what is missing (No labels), and an interactive one is named for what pressing it does.

Casing, punctuation and tone are set library-wide, not by this component: Writing style is the source.