Components
Badge
Badges display a small count or status indicator, optionally positioned over another element.
Replacing soon
GitHubAnatomy
Anatomy
import {Badge} from '@staffbase/design';
<Badge />;Examples
Variants
55 notifications55 notifications55 notifications55 notifications
Empty (dot) badge
Truncated value
9+12 notifications9+100 notifications
Positioned over an element
33 notificationsNew activity
Inline
API reference
| Name | Type | Description |
|---|---|---|
a11yDescription | string | Visually hidden text to describe the badge value or status for screen readers. |
value | number | The number to display on the badge. Omit for a dot indicator. |
variant | primarysecondarycriticalgamification | Color style of the badge. |
position | topLefttopRightbottomLeftbottomRightinline | Position of the badge relative to the preceding DOM element, or inline alongside content. |
truncate | boolean | When true, displays 9+ for values greater than 9. Default: false |
When to use
When not to use
How to use
Variants
55 notifications55 notifications55 notifications55 notifications
Empty badge (dot)
New activityNew activity
Truncation
9+12 notifications9+100 notifications
Position
33 notifications44 unread notifications