Shards

Documentation

Badges

Last updated: February 6, 2018

Using the .badge class you can create badges and use them to label various components.

<button class="btn btn-outline-secondary">
  Notifications <span class="badge badge-secondary">10</span>
</button>

Contextual Variations

Badges are have also contextual variations.

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>

Outline Badges

Using the .badge-outline-{color} modifier class you can create outlined badges.

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

Pill Shaped Badges

Using the .badge-pill modifier class you can create pill shaped badges.

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>

Mixed

You can also combine outlined badges and pill shaped badges together.

Primary Secondary Success Danger Warning Info Light Dark
<span class="badge badge-pill badge-outline-primary">Primary</span>
<span class="badge badge-pill badge-outline-secondary">Secondary</span>
<span class="badge badge-pill badge-outline-success">Success</span>
<span class="badge badge-pill badge-outline-danger">Danger</span>
<span class="badge badge-pill badge-outline-warning">Warning</span>
<span class="badge badge-pill badge-outline-info">Info</span>
<span class="badge badge-pill badge-outline-light">Light</span>
<span class="badge badge-pill badge-outline-dark">Dark</span>