<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 emunits.
<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 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 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.
<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.
PrimarySecondarySuccessDangerWarningInfoLightDark
Use the .badge-pillmodifier class to make badges more rounded(with a larger border-radiusand additional horizontal padding). Useful if you miss the badges from v3.
Using the contextual .badge-*classes on an <a>element quickly provide actionablebadges with hover and focus states.
<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.
PrimarySecondarySuccessDangerWarningInfoLightDark
Use the .badge-pillmodifier class to make badges more rounded(with a larger border-radiusand additional horizontal padding). Useful if you miss the badges from v3.
Using the contextual .badge-*classes on an <a>element quickly provide actionablebadges with hover and focus states.