Usage
Badges scale to match the size of the immediate parent element by using relative font sizing and em
units.
Use .badge
to create a badge:
Use .badge-*
modifier classes to change the appearance of a badge:
Use .rounded
and .px-2
utilities to make badges rounded:
Use contextual .badge-*
classes on a <a>
element to create actionable badges with hover and focus states.
Badges can be used as part of links or buttons to provide a counter.
Variants
Use the badge-variant
Sass mixin to create your own badge variants.
For example, the following Sass code creates a new purple badge (.badge-purple
):
.badge-purple {
@include badge-variant(#4329d4);
}