Bootstrap 5 badges are small count or label indicators attached to elements. This page covers 4 badge patterns — basic, pill, button badges and positioned notification badges — each ready to copy directly.
Quick Setup
Badges need only Bootstrap 5 CSS:
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet"/>
Key Classes Reference
| Class | What It Does |
|---|---|
.badge | Required base class |
.bg-primary | Blue badge background |
.bg-success | Green badge background |
.bg-danger | Red badge background |
.bg-warning | Yellow badge (add text-dark) |
.rounded-pill | Fully rounded pill shape |
.position-relative | Required on parent for positioned badges |
.position-absolute | Positions badge over parent |
.top-0 .start-100 | Top-right corner position |
.translate-middle | Centers badge on the corner |
1. Bootstrap 5 Basic Badges
All Bootstrap 5 badge color variants. Use inside headings, paragraphs or standalone.
2. Bootstrap 5 Pill Badges
Rounded pill badges using rounded-pill class. Common for tags, categories and status labels.
3. Bootstrap 5 Badge on Buttons
Badges inside buttons for notification counts on nav items and action buttons.
4. Bootstrap 5 Positioned Notification Badge
Badges positioned on top of icons or buttons using position utilities. Common in nav and icon buttons.
Frequently Asked Questions
Need a Full Bootstrap 5 Admin Dashboard?
Get a complete Angular 21 + Bootstrap 5 dashboard with 50+ components — built by the same team behind BootstrapPlanet.
Browse Templates →Use code FIRST30 for 30% off your first purchase.