Bootstrap Badge

Documentation and examples for Bootstrap badges, our small count and labelling component.


Examples

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

<button type="button" class="btn btn-warning">
  <span>Unread messages</span>
  <span class="badge badge-secondary">24</span>
</button>

Contextual variations

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

Primary Secondary Info Success Danger Warning

<span class="badge badge-primary">Primary</span>
<span class="badge badge-secondary">Secondary</span>
<span class="badge badge-info">Info</span>
<span class="badge badge-success">Success</span>
<span class="badge badge-danger">Danger</span>
<span class="badge badge-warning">Warning</span>

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 Info Success Danger Warning

<span class="badge badge-pill badge-primary">Primary</span>
<span class="badge badge-pill badge-secondary">Secondary</span>
<span class="badge badge-pill badge-info">Info</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>