Notification Badge
betaA dot, rolling count or presence badge pinned to the corner of an icon, button or avatar.
- Feedback
- 1 file
- 1 npm package
- Accessibility notes
pnpm dlx @dowel-ui/cli add notification-badgenpm packages installed: class-variance-authority.
import { NotificationBadge } from "@/components/ui/notification-badge";Default
Gallery
Status
Inline
<NotificationBadge>
| Prop | Type | Default |
|---|---|---|
badgeClassNameClasses for the badge itself; | string | — |
countThe number shown by the | number | 0 |
labelScreen-reader text for the badge. Defaults to "3 notifications", "More than 99 notifications", "New" for a dot and the status name for a status. | string | — |
liveAnnounce changes politely. Off by default: most badges should not interrupt. | boolean | false |
maxCounts above this show as "max+". | number | 99 |
pingA ring that pulses outward from the badge. Not rendered under reduced motion. | boolean | false |
position | "top-end" | "top-start" | "bottom-end" | "bottom-start" | "inline" | "top-end" |
showZeroShow the | boolean | false |
statusPresence for the | NotificationBadgeStatus | "online" |
toneBadge colour for | BadgeProps["variant"] | "default" |
variant | "dot" | "count" | "status" | "dot" |
childrenThe element the badge is pinned to. Without it the badge renders inline. | ReactNode | — |
Plus every attribute of <span> except children.
8/8
checks passed
- Tested — passes
- axe assertion — passes
- Keyboard tested — does not apply
- Storybook examples — passes
- Accessibility documented — passes
- Semantic tokens only — passes
- Motion from tokens — passes
- className merged — passes
- Visible focus — does not apply
- No fixed widths — passes