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.
Focused plan New
Reports Beta
Inbox 18
<h3>Focused 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">18</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">6</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">25</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">2</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">57+<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-5.svg" alt="Samir Whitaker" 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">
Samir
</div>
</div>
<div class="text-center">
<span class="position-relative d-inline-block"><img src="../assets/img/avatar-6.svg" alt="Ava Rossi" 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">
Ava
</div>
</div>
<div class="text-center">
<span class="position-relative d-inline-block"><img src="../assets/img/avatar-3.svg" alt="Priya Silva" 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">
Priya
</div>
</div>
<div class="text-center">
<span class="position-relative d-inline-block"><img src="../assets/img/avatar-8.svg" alt="Lea Haddad" 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">
Lea
</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 |
|---|---|---|---|
| #INV-1221 | Jonah Patel | $304.98 | Paid |
| #PO-7130 | Arjun Quinn | $419.75 | Pending |
| #TX-5026 | Ravi Tanaka | $85.77 | Refunded |
| #PO-6225 | Omar Novak | $289.93 | 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>#INV-1221</td>
<td>Jonah Patel</td>
<td>$304.98</td>
<td><span class="badge rounded-pill bg-success-subtle text-success-emphasis">Paid</span></td>
</tr>
<tr>
<td>#PO-7130</td>
<td>Arjun Quinn</td>
<td>$419.75</td>
<td><span class="badge rounded-pill bg-warning-subtle text-warning-emphasis">Pending</span></td>
</tr>
<tr>
<td>#TX-5026</td>
<td>Ravi Tanaka</td>
<td>$85.77</td>
<td><span class="badge rounded-pill bg-secondary-subtle text-secondary-emphasis">Refunded</span></td>
</tr>
<tr>
<td>#PO-6225</td>
<td>Omar Novak</td>
<td>$289.93</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">#case study</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">#community</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">#design</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">#news</a><a href="#" class="badge rounded-pill text-bg-light border text-decoration-none fw-normal fs-6">#tutorial</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">Environment
<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.
Solar lamp
$21.00Teacher training
$128.00Monthly gift
$23.00<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-11.svg" class="card-img-top" alt="Solar lamp"><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">Solar lamp</h6>
<span class="fw-semibold">$21.00</span>
</div>
</div>
</div>
<div class="col">
<div class="card h-100">
<div class="position-relative">
<img src="../assets/img/product-8.svg" class="card-img-top" alt="Teacher training"><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">Teacher training</h6>
<span class="fw-semibold">$128.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 gift"><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">Monthly gift</h6>
<span class="fw-semibold">$23.00</span>
</div>
</div>
</div>
</div>15Plan and version labels
Small labels next to names flag plans, roles or software versions.
- Theo Nguyen Pro
- Diego Duarte Admin Owner
- Mobile app v4.4
- Insights Beta
<ul class="list-unstyled mb-0">
<li class="mb-2">Theo Nguyen <span class="badge text-bg-primary"><i class="bi bi-gem" aria-hidden="true"></i> Pro</span></li>
<li class="mb-2">Diego Duarte <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.4</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.
- Inbox30
- Starred6
- 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">30</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">6</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">
$26<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">66</span></a></li>
<li class="nav-item"><a class="nav-link" href="#">Open <span class="badge text-bg-primary">5</span></a></li>
<li class="nav-item"><a class="nav-link" href="#">Closed <span class="badge text-bg-secondary">45</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-3.svg" alt="Kenji Carter" class="rounded-circle border border-2 border-white ca-stack" width="40" height="40"><img src="../assets/img/avatar-1.svg" alt="Isla Moreau" class="rounded-circle border border-2 border-white ca-stack" width="40" height="40"><img src="../assets/img/avatar-8.svg" alt="Leo Novak" class="rounded-circle border border-2 border-white ca-stack" width="40" height="40"><img src="../assets/img/avatar-12.svg" alt="Elena Kim" class="rounded-circle border border-2 border-white ca-stack" width="40" height="40"><span class="badge rounded-pill text-bg-secondary ms-2">+9 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.4</span><span><span class="badge text-bg-primary fs-5">9.6</span> <span class="fw-semibold">Excellent</span> <span class="text-body-secondary small">509 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>