ComponentsBadge

Badge

Display customizable badges for various purposes



Primary
Green
Red
Blue
Purple
Solid
Square
Border
Green
Hover


The Badge component creates a customizable badge that can be used to label, categorize, or highlight information.

Tip!

Use the color and style props to match the badge appearance to your application's design system.

Warning!

Ensure that the text content inside the badge is concise to prevent overflow issues, especially with smaller shapes like 'circle'.




Props

The Badge component accepts the following props:

PropTypeDefaultDescription
childrenReactNode-The content to be displayed inside the badge
classNamestring''Additional CSS classes to be applied
shape'pill' | 'square' | 'circle''pill'The shape of the badge
borderbooleanfalseWhether to display a border around the badge
style'soft' | 'solid''soft'The style of the badge (soft or solid background)
color'primary' | 'green' | 'red' | 'yellow' | 'orange' | 'blue' | 'purple' | 'gray''primary'The color scheme of the badge
hoverbooleanfalseWhether to apply a hover effect
onClickfunction-Function to be called when the badge is clicked

Info

The makeClassNameImportant utility is used to ensure custom classes take precedence over default styles.


Usage Examples

Basic Badge

New

Customized Badge

Success

Badge with Hover Effect

Click me

Different Colors and Styles

Primary
Red
Yellow
Blue