close

# Badges

Documentation and examples for badges, our small count and labeling component.

##### Basic

Badges scale to match the size of the immediate parent element by using relative font sizing and `em` units. As of v5, badges no longer have focus or hover styles for links.

# Example heading New

    <h1>Example heading <span class="badge badge-secondary">New</span></h1>
    <h2>Example heading <span class="badge badge-secondary">New</span></h2>
    <h3>Example heading <span class="badge badge-secondary">New</span></h3>
    <h4>Example heading <span class="badge badge-secondary">New</span></h4>
    <h5>Example heading <span class="badge badge-secondary">New</span></h5>
    <h6>Example heading <span class="badge badge-secondary">New</span></h6>

Badges can be used as part of links or buttons to provide a counter.

    <button type="button" class="btn btn-dark">
        Notifications <span class="badge badge-danger m-l-xxs">4</span>
    </button>

Note that depending on how they are used, badges may be confusing for users of screen readers and similar assistive technologies. While the styling of badges provides a visual cue as to their purpose, these users will simply be presented with the content of the badge. Depending on the specific situation, these badges may seem like random additional words or numbers at the end of a sentence, link, or button.

##### AvatarsExclusive

Easily combine them with our avatar components auto_awesome

99+
$40
LK
17

    <div class="avatar">
        <span class="badge rounded-pill badge-danger">99+</span>
        <img src="..." alt="">
    </div>
    <div class="avatar">
        <span class="badge rounded-pill badge-success">$40</span>
        <div class="avatar-title">LK</div>
    </div>
    <div class="avatar avatar-rounded">
        <span class="badge rounded-pill badge-dark">17</span>
        <img src="..." alt="">
    </div>

##### Background

Use our background utility classes to quickly change the appearance of a badge. Please note that when using Bootstrap’s default `.bg-light`, you’ll likely need a text color utility like `.text-dark` for proper styling. This is because background utilities do not set anything but `background-color`.

Primary Secondary Success Danger Warning Info Light Dark

    <span class="badge badge-primary">Primary</span>
    <span class="badge badge-secondary">Secondary</span>
    <span class="badge badge-success">Success</span>
    <span class="badge badge-danger">Danger</span>
    <span class="badge badge-warning">Warning</span>
    <span class="badge badge-info">Info</span>
    <span class="badge badge-light text-dark">Light</span>
    <span class="badge badge-dark">Dark</span>

##### Pill badges

Use the `.rounded-pill` utility class to make badges more rounded with a larger `border-radius`.

Primary Secondary Success Danger Warning Info Light Dark

    <span class="badge rounded-pill badge-primary">Primary</span>
    <span class="badge rounded-pill badge-secondary">Secondary</span>
    <span class="badge rounded-pill badge-success">Success</span>
    <span class="badge rounded-pill badge-danger">Danger</span>
    <span class="badge rounded-pill badge-warning">Warning</span>
    <span class="badge rounded-pill badge-info">Info</span>
    <span class="badge rounded-pill badge-light text-dark">Light</span>
    <span class="badge rounded-pill badge-dark">Dark</span>

##### LightExclusive

Use `.badge-style-light` class to make badges look lighter.

Primary Secondary Success Danger Warning Info Light Dark

    <span class="badge badge-style-light rounded-pill badge-primary">Primary</span>
    <span class="badge badge-style-light rounded-pill badge-secondary">Secondary</span>
    <span class="badge badge-style-light rounded-pill badge-success">Success</span>
    <span class="badge badge-style-light rounded-pill badge-danger">Danger</span>
    <span class="badge badge-style-light rounded-pill badge-warning">Warning</span>
    <span class="badge badge-style-light rounded-pill badge-info">Info</span>
    <span class="badge badge-style-light rounded-pill badge-light text-dark">Light</span>
    <span class="badge badge-style-light rounded-pill badge-dark">Dark</span>

##### BorderedExclusive

Use `.badge-style-bordered` class to get badges only with border.

Primary Secondary Success Danger Warning Info Light Dark

    <span class="badge badge-style-bordered rounded-pill badge-primary">Primary</span>
    <span class="badge badge-style-bordered badge-secondary">Secondary</span>
    <span class="badge badge-style-bordered badge-success">Success</span>
    <span class="badge badge-style-bordered badge-danger">Danger</span>
    <span class="badge badge-style-bordered badge-warning">Warning</span>
    <span class="badge badge-style-bordered badge-info">Info</span>
    <span class="badge badge-style-bordered badge-light text-dark">Light</span>
    <span class="badge badge-style-bordered badge-dark">Dark</span>