Badges scale to match the size of the immediate parent element by using relative font sizing and em units.

Badges can be used as part of links or buttons to provide a counter.

css class description
badge Defines a badge.
badge-pill Specifies more rounded badge.
badge-primary Defines a badge with primary color. There are other colors:
  • badge-primary - badge with the primary color
  • badge-secondary - badge with the secondary color
  • badge-success - badge with the success color
  • badge-danger - badge with the danger color
  • badge-warning - badge with the warning color
  • badge-info - badge with the info color
  • badge-light - badge with the light color
  • badge-dark - badge with the dark color
Using these classes on an <a> element quickly provide actionable badges with hover and focus states.


Primary Secondary Success Danger Warning Info Light Dark
<span class="badge badge-primary">Primary</span>
<span class="badge badge-secondary">Secondary</span>
<span class="badge badge-success">Success</span>
<span class="badge badge-danger">Danger</span>
<span class="badge badge-warning">Warning</span>
<span class="badge badge-info">Info</span>
<span class="badge badge-light">Light</span>
<span class="badge badge-dark">Dark</span>
Primary Secondary Success Danger Warning Info Light Dark
<span class="badge badge-pill badge-primary">Primary</span>
<span class="badge badge-pill badge-secondary">Secondary</span>
<span class="badge badge-pill badge-success">Success</span>
<span class="badge badge-pill badge-danger">Danger</span>
<span class="badge badge-pill badge-warning">Warning</span>
<span class="badge badge-pill badge-info">Info</span>
<span class="badge badge-pill badge-light">Light</span>
<span class="badge badge-pill badge-dark">Dark</span>
Primary Secondary Success Danger Warning Info Light Dark
<a href="#" class="badge badge-primary">Primary</a>
<a href="#" class="badge badge-secondary">Secondary</a>
<a href="#" class="badge badge-success">Success</a>
<a href="#" class="badge badge-danger">Danger</a>
<a href="#" class="badge badge-warning">Warning</a>
<a href="#" class="badge badge-info">Info</a>
<a href="#" class="badge badge-light">Light</a>
<a href="#" class="badge badge-dark">Dark</a>
<button type="button" class="btn btn-primary">
  Profile <span class="badge badge-light">9</span>
  <span class="sr-only">unread messages</span>