Badge
Badges are small labels for counts, statuses and tags. They take their size from the surrounding text, so they work in headings, buttons, tables and lists alike; combine them with colour, pill shape and position utilities.
1Background colours
text-bg-* sets a background and a readable text colour in one class.
<div class="d-flex flex-wrap gap-2">
<span class="badge text-bg-primary">Primary</span><span class="badge text-bg-secondary">Secondary</span><span class="badge text-bg-success">Success</span><span class="badge text-bg-danger">Danger</span><span class="badge text-bg-warning">Warning</span><span class="badge text-bg-info">Info</span><span class="badge text-bg-light">Light</span><span class="badge text-bg-dark">Dark</span>
</div>2Pill badges
rounded-pill gives badges fully rounded ends.
<div class="d-flex flex-wrap gap-2">
<span class="badge rounded-pill text-bg-primary">Primary</span><span class="badge rounded-pill text-bg-secondary">Secondary</span><span class="badge rounded-pill text-bg-success">Success</span><span class="badge rounded-pill text-bg-danger">Danger</span><span class="badge rounded-pill text-bg-warning">Warning</span><span class="badge rounded-pill text-bg-info">Info</span><span class="badge rounded-pill text-bg-light">Light</span><span class="badge rounded-pill text-bg-dark">Dark</span>
</div>3Subtle badges
Soft background, emphasis text and a subtle border: a quieter style for dense tables.
<div class="d-flex flex-wrap gap-2">
<span class="badge bg-primary-subtle text-primary-emphasis border border-primary-subtle">Primary</span><span class="badge bg-secondary-subtle text-secondary-emphasis border border-secondary-subtle">Secondary</span><span class="badge bg-success-subtle text-success-emphasis border border-success-subtle">Success</span><span class="badge bg-danger-subtle text-danger-emphasis border border-danger-subtle">Danger</span><span class="badge bg-warning-subtle text-warning-emphasis border border-warning-subtle">Warning</span><span class="badge bg-info-subtle text-info-emphasis border border-info-subtle">Info</span>
</div>4Badges in headings
Badges scale with the font size of their parent.
Reliable plan New
Reports Beta
Inbox 5
<h3>Reliable plan <span class="badge text-bg-secondary">New</span></h3>
<h4>Reports <span class="badge text-bg-primary">Beta</span></h4>
<h5 class="mb-0">Inbox <span class="badge text-bg-danger">5</span></h5>5Counters in buttons
A badge inside a button shows how many items wait behind it.
<div class="d-flex flex-wrap gap-2">
<button type="button" class="btn btn-primary">Messages <span class="badge text-bg-light">8</span></button>
<button type="button" class="btn btn-outline-secondary"><i class="bi bi-bell-fill" aria-hidden="true"></i> Alerts <span class="badge text-bg-danger">35</span></button>
<button type="button" class="btn btn-success"><i class="bi bi-cart3" aria-hidden="true"></i> Cart <span class="badge rounded-pill text-bg-light">5</span></button>
</div>6Positioned notification badges
Use position utilities to pin a counter or dot on the corner of a button.
<div class="d-flex flex-wrap gap-4 pt-2">
<button type="button" class="btn btn-primary position-relative">Inbox<span class="position-absolute top-0 start-100 translate-middle badge rounded-pill bg-danger">65+<span class="visually-hidden">unread messages</span></span></button>
<button type="button" class="btn btn-light border position-relative" aria-label="Notifications"><i class="bi bi-bell-fill" aria-hidden="true"></i><span class="position-absolute top-0 start-100 translate-middle p-2 bg-danger border border-light rounded-circle"><span class="visually-hidden">New alerts</span></span></button>
<button type="button" class="btn btn-outline-dark position-relative" aria-label="Shopping cart"><i class="bi bi-bag-fill" aria-hidden="true"></i><span class="position-absolute top-0 start-100 translate-middle badge rounded-pill bg-primary">6</span></button>
</div>7Status dots on avatars
Small round badges show presence: online, away, offline or busy.
<div class="d-flex flex-wrap gap-4">
<div class="text-center">
<span class="position-relative d-inline-block"><img src="../assets/img/avatar-3.svg" alt="Ruby Morgan" class="rounded-circle flex-shrink-0" width="56" height="56"><span class="position-absolute bottom-0 end-0 p-2 bg-success border border-2 border-white rounded-circle"><span class="visually-hidden">Online</span></span></span>
<div class="small mt-1">
Ruby
</div>
</div>
<div class="text-center">
<span class="position-relative d-inline-block"><img src="../assets/img/avatar-2.svg" alt="Amara Okafor" class="rounded-circle flex-shrink-0" width="56" height="56"><span class="position-absolute bottom-0 end-0 p-2 bg-warning border border-2 border-white rounded-circle"><span class="visually-hidden">Away</span></span></span>
<div class="small mt-1">
Amara
</div>
</div>
<div class="text-center">
<span class="position-relative d-inline-block"><img src="../assets/img/avatar-12.svg" alt="Isla Mensah" class="rounded-circle flex-shrink-0" width="56" height="56"><span class="position-absolute bottom-0 end-0 p-2 bg-secondary border border-2 border-white rounded-circle"><span class="visually-hidden">Offline</span></span></span>
<div class="small mt-1">
Isla
</div>
</div>
<div class="text-center">
<span class="position-relative d-inline-block"><img src="../assets/img/avatar-5.svg" alt="Zoe Nguyen" class="rounded-circle flex-shrink-0" width="56" height="56"><span class="position-absolute bottom-0 end-0 p-2 bg-danger border border-2 border-white rounded-circle"><span class="visually-hidden">Busy</span></span></span>
<div class="small mt-1">
Zoe
</div>
</div>
</div>8Badges with icons
An icon before the label adds meaning without extra words.
<div class="d-flex flex-wrap gap-2">
<span class="badge text-bg-success"><i class="bi bi-check-circle-fill" aria-hidden="true"></i> Paid</span><span class="badge text-bg-warning"><i class="bi bi-clock-fill" aria-hidden="true"></i> Pending</span><span class="badge text-bg-danger"><i class="bi bi-x-circle-fill" aria-hidden="true"></i> Failed</span><span class="badge text-bg-info"><i class="bi bi-truck" aria-hidden="true"></i> In transit</span><span class="badge text-bg-dark"><i class="bi bi-lock-fill" aria-hidden="true"></i> Private</span>
</div>9Outline badges
Border and text colour utilities make a light outline style.
<div class="d-flex flex-wrap gap-2">
<span class="badge border border-primary text-primary">Primary</span><span class="badge border border-secondary text-secondary">Secondary</span><span class="badge border border-success text-success">Success</span><span class="badge border border-danger text-danger">Danger</span><span class="badge border border-warning text-warning">Warning</span><span class="badge border border-info text-info">Info</span>
</div>10Status badges in a table
Pill badges are the usual way to show order or payment status in admin tables.
| Order | Customer | Total | Status |
|---|---|---|---|
| #PO-6186 | Diego Varga | $519.34 | Paid |
| #ORD-2930 | Samir Moreau | $476.71 | Pending |
| #ORD-7710 | Lea Kim | $356.73 | Refunded |
| #PO-9440 | Maya Ibrahim | $67.73 | Failed |
<div class="table-responsive">
<table class="table align-middle mb-0">
<thead>
<tr>
<th scope="col">Order</th>
<th scope="col">Customer</th>
<th scope="col">Total</th>
<th scope="col">Status</th>
</tr>
</thead>
<tbody>
<tr>
<td>#PO-6186</td>
<td>Diego Varga</td>
<td>$519.34</td>
<td><span class="badge rounded-pill bg-success-subtle text-success-emphasis">Paid</span></td>
</tr>
<tr>
<td>#ORD-2930</td>
<td>Samir Moreau</td>
<td>$476.71</td>
<td><span class="badge rounded-pill bg-warning-subtle text-warning-emphasis">Pending</span></td>
</tr>
<tr>
<td>#ORD-7710</td>
<td>Lea Kim</td>
<td>$356.73</td>
<td><span class="badge rounded-pill bg-secondary-subtle text-secondary-emphasis">Refunded</span></td>
</tr>
<tr>
<td>#PO-9440</td>
<td>Maya Ibrahim</td>
<td>$67.73</td>
<td><span class="badge rounded-pill bg-danger-subtle text-danger-emphasis">Failed</span></td>
</tr>
</tbody>
</table>
</div>11Tag cloud
Badges as links make a list of tags or categories.
<div class="d-flex flex-wrap gap-2">
<a href="#" class="badge rounded-pill text-bg-light border text-decoration-none fw-normal fs-6">#tutorial</a><a href="#" class="badge rounded-pill text-bg-light border text-decoration-none fw-normal fs-6">#community</a><a href="#" class="badge rounded-pill text-bg-light border text-decoration-none fw-normal fs-6">#release</a><a href="#" class="badge rounded-pill text-bg-light border text-decoration-none fw-normal fs-6">#product</a><a href="#" class="badge rounded-pill text-bg-light border text-decoration-none fw-normal fs-6">#update</a><a href="#" class="badge rounded-pill text-bg-light border text-decoration-none fw-normal fs-6">#tips</a><a href="#" class="badge rounded-pill text-bg-light border text-decoration-none fw-normal fs-6">#case study</a><a href="#" class="badge rounded-pill text-bg-light border text-decoration-none fw-normal fs-6">#news</a>
</div>12Removable chips
A small close button inside a pill badge, as used for active filters.
<div class="d-flex flex-wrap gap-2">
<span class="badge rounded-pill text-bg-light border d-inline-flex align-items-center gap-2 fw-normal fs-6 py-1">HIIT
<button type="button" class="btn-close" style="font-size: .55rem;" aria-label="Remove filter"></button>
</span><span class="badge rounded-pill text-bg-light border d-inline-flex align-items-center gap-2 fw-normal fs-6 py-1">Under $100
<button type="button" class="btn-close" style="font-size: .55rem;" aria-label="Remove filter"></button>
</span><span class="badge rounded-pill text-bg-light border d-inline-flex align-items-center gap-2 fw-normal fs-6 py-1">In stock
<button type="button" class="btn-close" style="font-size: .55rem;" aria-label="Remove filter"></button>
</span><span class="badge rounded-pill text-bg-light border d-inline-flex align-items-center gap-2 fw-normal fs-6 py-1">4 stars & up
<button type="button" class="btn-close" style="font-size: .55rem;" aria-label="Remove filter"></button>
</span>
</div>13Badge sizes
Badges inherit font size, so font-size utilities make them bigger or smaller.
<div class="d-flex flex-wrap align-items-center gap-2">
<span class="badge text-bg-primary small" style="font-size: .65rem;">Tiny</span><span class="badge text-bg-primary">Default</span><span class="badge text-bg-primary fs-6">Medium</span><span class="badge text-bg-primary fs-5">Large</span><span class="badge text-bg-primary fs-4 px-3">Huge</span>
</div>14Product labels
Badges positioned on product photos highlight sales and new arrivals.
Day pass
$14.00Monthly pass
$50.00Personal training
$71.99<div class="row row-cols-1 row-cols-sm-3 g-3">
<div class="col">
<div class="card h-100">
<div class="position-relative">
<img src="../assets/img/product-6.svg" class="card-img-top" alt="Day pass"><span class="badge text-bg-danger position-absolute top-0 start-0 m-2">Sale</span>
</div>
<div class="card-body">
<h6 class="card-title mb-1">Day pass</h6>
<span class="fw-semibold">$14.00</span>
</div>
</div>
</div>
<div class="col">
<div class="card h-100">
<div class="position-relative">
<img src="../assets/img/product-1.svg" class="card-img-top" alt="Monthly pass"><span class="badge text-bg-success position-absolute top-0 start-0 m-2">New</span>
</div>
<div class="card-body">
<h6 class="card-title mb-1">Monthly pass</h6>
<span class="fw-semibold">$50.00</span>
</div>
</div>
</div>
<div class="col">
<div class="card h-100">
<div class="position-relative">
<img src="../assets/img/product-9.svg" class="card-img-top" alt="Personal training"><span class="badge text-bg-warning position-absolute top-0 start-0 m-2">Best seller</span>
</div>
<div class="card-body">
<h6 class="card-title mb-1">Personal training</h6>
<span class="fw-semibold">$71.99</span>
</div>
</div>
</div>
</div>15Plan and version labels
Small labels next to names flag plans, roles or software versions.
- Jonah Quinn Pro
- Priya Alvarez Admin Owner
- Mobile app v4.1
- Insights Beta
<ul class="list-unstyled mb-0">
<li class="mb-2">Jonah Quinn <span class="badge text-bg-primary"><i class="bi bi-gem" aria-hidden="true"></i> Pro</span></li>
<li class="mb-2">Priya Alvarez <span class="badge text-bg-dark">Admin</span> <span class="badge border text-body-secondary">Owner</span></li>
<li class="mb-2">Mobile app <span class="badge bg-info-subtle text-info-emphasis">v4.1</span></li>
<li>Insights <span class="badge text-bg-warning">Beta</span></li>
</ul>16Counts in a list group
Pill badges aligned to the end of list items show a count per category.
- Inbox33
- Starred7
- Trash3
<ul class="list-group" style="max-width: 380px;">
<li class="list-group-item d-flex justify-content-between align-items-center"><i class="bi bi-inbox-fill" aria-hidden="true"></i> <span class="me-auto ms-2">Inbox</span><span class="badge text-bg-primary rounded-pill">33</span></li>
<li class="list-group-item d-flex justify-content-between align-items-center"><i class="bi bi-star-fill" aria-hidden="true"></i> <span class="me-auto ms-2">Starred</span><span class="badge text-bg-secondary rounded-pill">7</span></li>
<li class="list-group-item d-flex justify-content-between align-items-center"><i class="bi bi-trash-fill" aria-hidden="true"></i> <span class="me-auto ms-2">Trash</span><span class="badge text-bg-light rounded-pill">3</span></li>
</ul>17Most popular ribbon
A badge on the top edge of a pricing card marks the recommended plan.
Team
<div class="card border-primary text-center position-relative mx-auto mt-3" style="max-width: 280px;">
<span class="position-absolute top-0 start-50 translate-middle badge rounded-pill text-bg-primary px-3 py-2"><i class="bi bi-star-fill" aria-hidden="true"></i> Most popular</span>
<div class="card-body pt-4">
<h5 class="card-title">Team</h5>
<div class="display-6 fw-bold">
$40<span class="fs-6 fw-normal text-body-secondary">/month</span>
</div>
<button type="button" class="btn btn-primary w-100 mt-3">Choose Team</button>
</div>
</div>18Counts in navigation
Badges inside nav pills show how many items each tab holds.
<ul class="nav nav-pills gap-1">
<li class="nav-item"><a class="nav-link active" aria-current="page" href="#">All <span class="badge text-bg-light">84</span></a></li>
<li class="nav-item"><a class="nav-link" href="#">Open <span class="badge text-bg-primary">16</span></a></li>
<li class="nav-item"><a class="nav-link" href="#">Closed <span class="badge text-bg-secondary">39</span></a></li>
</ul>19Avatar group with overflow
Overlapping avatars followed by a +N badge for the people not shown.
<div class="d-flex align-items-center">
<img src="../assets/img/avatar-12.svg" alt="Kenji Silva" class="rounded-circle border border-2 border-white ca-stack" width="40" height="40"><img src="../assets/img/avatar-1.svg" alt="Lucas Larsen" class="rounded-circle border border-2 border-white ca-stack" width="40" height="40"><img src="../assets/img/avatar-1.svg" alt="Mia Whitaker" class="rounded-circle border border-2 border-white ca-stack" width="40" height="40"><img src="../assets/img/avatar-12.svg" alt="Freya Ortega" class="rounded-circle border border-2 border-white ca-stack" width="40" height="40"><span class="badge rounded-pill text-bg-secondary ms-2">+4 more</span>
</div>20Scores and ratings
Badges summarise review scores and quality ratings.
<div class="d-flex flex-wrap gap-3 align-items-center">
<span class="badge text-bg-success fs-6"><i class="bi bi-star-fill" aria-hidden="true"></i> 4.1</span><span><span class="badge text-bg-primary fs-5">9.4</span> <span class="fw-semibold">Excellent</span> <span class="text-body-secondary small">347 reviews</span></span><span class="badge bg-warning-subtle text-warning-emphasis"><i class="bi bi-award-fill" aria-hidden="true"></i> Top rated</span>
</div>