Skip to main content

Badge

The Badge component shows a small label or indicator that is attached to another element, such as a button, an icon, or a menu item. The Badge component can be used to display counts, statuses, or other short information. The Badge component can have different variants, such as filled or outlined, and different colors.

You can find the Badges component in the src/views/Badges.jsx file

Examples

Badges scale to match the size of the immediate parent element by using size and em units. Badge Preview

Result

Example heading New

Example heading New

Example heading New

Example heading New

Example heading New
Example heading New

With Button Counter

Badge use also counter with append <Button > or any other component. Badge Preview

Result


Contextual Variations Add any of the below mentioned modifier classes to change

the appearance of a badge. Badge Preview

Result

PrimarySecondarySuccessDangerWarningInfoLightDark

Pill badges Use the pill modifier props to make badges more rounded. Badge Preview

Result

PrimarySecondarySuccessDangerWarningInfoLightDark

Props

NameTypeDefaultDescription
bg

primary, secondary, success, danger, warning, info, light, dark

primary

A string that specifies the background color of the badge. You can choose from eight options: primary, secondary, success, danger, warning, info, dark, or light. The default value is primary.

pillbooleanfalse

A boolean that indicates whether the badge has a rounded shape or not. If pill is true, the badge will have a pill-like shape with rounded corners. If pill is false, the badge will have a square shape with sharp corners. The default value is false.

For more props please visit to react-bootstrap