Badge


<h1 class="mt-2">Example heading <span class="badge  badge-primary">New</span></h1>

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

Example heading New

Example heading New

Example heading New

Example heading New

Example heading New
Example heading New

Button Badges


<button type="button" class="btn mb-1 btn-primary">
  Notifications <span class="badge badge-light ml-2">4</span>
</button>

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

Button Light background Badges


<button type="button" class="btn mb-1 btn-outline-primary">
  Notifications <span class="badge badge-primary ml-2">4</span>
</button>

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

Button Border Badges


<button type="button" class="btn mb-1 bg-primary-light">
  Notifications <span class="badge badge-primary ml-2">4</span>
</button>

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

Contextual variations


<span class="mt-2 badge badge-primary">Primary</span>
<span class="mt-2 badge badge-pill badge-primary">Primary</span>
<a href="#" class="mt-2 badge badge-primary">Primary</a>

Add any of the below mentioned modifier classes to change the appearance of a badge.

Primary Secondary Success Danger Warning Info Light Dark
Pill badges

Use the .badge-pill modifier class to make badges more rounded (with a larger border-radius and additional horizontal padding). Useful if you miss the badges from v3.

Primary Secondary Success Danger Warning Info Light Dark
Links

Using the contextual .badge-* classes on an <a> element quickly provide actionable badges with hover and focus states.

Primary Secondary Success Danger Warning Info Light Dark

Contextual variations Border


<span class="mt-2 badge border border-primary text-primary mt-2">Primary</span>
<span class="mt-2 badge badge-pill border border-primary text-primary">Primary</span>
<a href="#" class="mt-2 badge border border-primary text-primary">Primary</a>

Add any of the below mentioned modifier classes to change the appearance of a badge.

Primary Secondary Success Danger Warning Info Light Dark
Pill badges

Use the .badge-pill modifier class to make badges more rounded (with a larger border-radius and additional horizontal padding). Useful if you miss the badges from v3.

Primary Secondary Success Danger Warning Info Light Dark
Links

Using the contextual .badge-* classes on an <a> element quickly provide actionable badges with hover and focus states.

Primary Secondary Success Danger Warning Info Light Dark