Skip to component content

Add compact labels, counts, and statuses with Bootstrap's native badge component.

Badge New Blocked

Usage

Use .badge for compact labels, counts, and status hints that belong to nearby text or controls. Place it next to the heading, item label, button, or row it describes; Bootstrap sizes badges with relative font sizing and em units, so the badge naturally follows the scale of its immediate parent.

Use .text-bg-* variants when the badge needs a semantic color with matching foreground contrast, and use .rounded-pill when the label should read as a softer pill. Keep badge text short, reserve strong variants for meaningful states, and avoid using color alone to explain the status.

For counters on buttons or positioned corner indicators, make the surrounding label carry most of the meaning. If the badge only contains a number, symbol, or dot, add extra context with .visually-hidden so assistive technologies hear the full meaning instead of an isolated value.

Variants

Use a compact set: default, secondary, destructive, and outline.

Badge
Badge Secondary Destructive Outline
<div class="d-flex flex-wrap gap-2">
  <span class="badge text-bg-primary">Badge</span>
  <span class="badge text-bg-secondary">Secondary</span>
  <span class="badge text-bg-danger">Destructive</span>
  <span class="badge border text-body-secondary">Outline</span>
</div>

Status labels

Reserve extra Bootstrap statuses for product states that need a recognizable semantic cue.

Badge
Connected Beta Draft Blocked
<div class="d-flex flex-wrap gap-2">
  <span class="badge border text-body-secondary">Connected</span>
  <span class="badge text-bg-secondary">Beta</span>
  <span class="badge text-bg-warning">Draft</span>
  <span class="badge text-bg-danger">Blocked</span>
</div>

Counts

When a badge is only a number, add visually hidden context so screen readers hear what the count means.

Badge
Inbox 12unread messages Chats 3new chats
<div class="d-flex flex-wrap align-items-center gap-3">
  <span class="d-inline-flex align-items-center gap-2">
    Inbox
    <span class="badge text-bg-secondary">
      12
      <span class="visually-hidden">unread messages</span>
    </span>
  </span>
  <span class="d-inline-flex align-items-center gap-2">
    Chats
    <span class="badge text-bg-primary rounded-pill">
      3
      <span class="visually-hidden">new chats</span>
    </span>
  </span>
</div>

RTL

RTL

طلب الوصول قيد المراجعة
<div dir="rtl">
  <span class="d-inline-flex align-items-center gap-2">
    طلب الوصول
    <span class="badge text-bg-warning">قيد المراجعة</span>
  </span>
</div>
בקשת גישה ממתינה לאישור
<div dir="rtl">
  <span class="d-inline-flex align-items-center gap-2">
    בקשת גישה
    <span class="badge text-bg-warning">ממתינה לאישור</span>
  </span>
</div>
Access request Pending approval
<div dir="ltr">
  <span class="d-inline-flex align-items-center gap-2">
    Access request
    <span class="badge text-bg-warning">Pending approval</span>
  </span>
</div>

Component reference

Status
Accepted
Runtime
native HTML/CSS
Markup
Bootstrap/native HTML
Reference

For positioned badges and accessibility notes, see the Bootstrap Badge documentation.

Settings

Theme
Choose how Moo UI looks on this device.
Sidebar
Choose how the sidebar sits on the page.
Theme Builder
Tune catalog tokens and chart colors for this browser.
Base color
Theme color
Chart color
Heading font
Body font
Radius
Direction
Choose the reading direction. RTL flips the layout live.
Reset

Restore the default appearance.