Badge
freeBadge adds low-noise counts or status markers to controls, rows, and labels.
6
Installation
Add this component with the NateUI CLI.
Examples
Basic
9New
Inline
999New
Count Overflow
9+99+
Dot
Placement
33
API
Badge accepts the props below plus native props for the root span.
| Prop | Description | Type | Default |
|---|---|---|---|
badgeStyle | Inline style applied to the badge indicator element. Positional styles override the generated placement classes. | CSSProperties | - |
children | Element the badge indicator is attached to. When omitted, Badge renders inline. | ReactNode | - |
className | Class names applied to the wrapper when children are present, or to the badge itself when inline. | string | - |
content | Count or label displayed inside the badge. Omit it to render a dot indicator. | string | number | - |
innerClass | Class names applied to the indicator element for custom color or sizing. | string | - |
maxCount | Maximum number to display before showing a + suffix. | number | 99 |
overlap | Geometry model used when the badge overlaps a child element. Match the target shape: square, round, or circle. | BadgeOverlap | 'round' |
placement | Corner where the badge indicator is anchored when children are present. | BadgePlacement | 'bottom-end' |
ref | Ref forwarded to the root span. | Ref<HTMLSpanElement> | - |
...nativeSpanProps | Native props for the root span. | NativeBadgeSpanProps | - |