Usage
Badge uses absolute positioning and should be placed inside a container with relative positioning. It can display text, numbers, or serve as a simple indicator.
Badge component displays small count or status indicators.
Experiment with all the properties of the Badge component in real time. Note: Badge uses absolute positioning and should be placed inside a relative container.
Text to display in the badge. Leave empty to use count or show as indicator.
Numeric count to display. Set to 0 to hide. Takes precedence over text.
Maximum count to display. Values exceeding this show as 'max+'.
Color scheme of the badge.
Size of the badge.
Border radius of the badge.
Badge uses absolute positioning and should be placed inside a container with relative positioning. It can display text, numbers, or serve as a simple indicator.
Use the count prop to display a numeric badge. The badge automatically hides when count is 0 or undefined.
Use maxCount to limit the displayed number. When count exceeds maxCount, the badge displays "maxCount+" to indicate there are more items.
Prop | Default | Type |
|---|---|---|
text | undefined | string |
count | undefined | number |
maxCount | undefined | number |
color | "danger" | "neutral" | "primary" | "secondary" | "success" | "danger" | "warning" | "info" |
size | "medium" | "tiny" | "small" | "medium" | "large" |
radius | "full" | "none" | "tiny" | "small" | "medium" | "large" | "full" |