Bootstrap documentation: Badge
Most of the details have been covered here
Material Design guidelines: Bottom navigation - Badges
Text with a badge
A badge can be appended to a text with 2 conditions:
- Text is wrapped in a
<span class="position-relative">
element. This text container must be ofposition: relative
for badge absolute positioning. - Badge is inserted within this text element.
Text with a badge 4
Button with a badge
Just add your badge element beside button’s text.
Badge can be left aligned with .badge-before
.
Icon with a badge
Add .position-relative
class to your <i>
or <span>
element containing your icon (material icons, Fontawesome …) and insert badge beside icon’s name.
.badge-before
class is still available.