React Badge Component

Badge

React badge component is small count and labeling component.

Other Frameworks

CoreUI components are available as native Angular, Bootstrap (Vanilla JS), and Vue components. To learn more please visit the following pages.

How to use React Badge Component.#

React badge component scales to suit the size of the parent element by using relative font sizing and em units.

Example heading New

Example heading New

Example heading New

Example heading New

Example heading New
Example heading New

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

Remark that depending on how you use them, react badges may be complicated for users of screen readers and related assistive technologies.

Unless the context is clear, consider including additional context with a visually hidden piece of additional text.

Positioned#

Use position prop to modify a component and position it in the corner of a link or button.


You can also create more generic indicators without a counter using a few more utilities.

Contextual variations#

Add any of the below-mentioned color props to modify the presentation of a react badge.

primarysuccessdangerwarninginfolightdark

You can also apply contextual variations with the textBgColor property, which automatically sets the text color to ensure compliance with the WCAG 4.5:1 contrast ratio standard for enhanced accessibility.

primarysuccessdangerwarninginfolightdark

Pill badges#

Apply the shape="rounded-pill" prop to make badges rounded.

primarysuccessdangerwarninginfolightdark

API#

Check out the documentation below for a comprehensive guide to all the props you can use with the components mentioned here.