This page as markdown: /notification-badge.md · Index for agents: /llms.txt · Everything in one file: /llms-full.txt

NotificationBadge

Status: stable

An unread indicator. Renders a bare dot or a count pill (capped as "{max}+"), or nothing when there's nothing to show. A changing count rolls to its new number, and a badge that appears after being empty pops in. overlay pins it to the corner of a relative host; it is aria-hidden, so the host's name carries the count.

Keywords: notification, badge, count, unread

Usage

Use NotificationBadge to show a compact unread count, alert count, or attention marker.

Best practices

Props

Name Type Default Description
dot boolean false Render a bare dot indicator with no number. Takes precedence over count.
count number — Unread count. Renders nothing when <= 0 and dot is unset.
max number 99 Cap before showing "{max}+".
tone "destructive" | "primary" | "neutral" "destructive" Fill color. destructive for alarming counts; primary/neutral for non-alarming ones.
size "sm" | "md" | "lg" "md" Scales the dot/pill on the spacing scale (count pill: sm 16px, md 18px, lg 20px at the default density).
overlay boolean false Pin to the top-end corner of the nearest relative host (an icon button) — one placement for every caller instead of hand-tuned absolute offsets.
motion "full" | "subtle" | "off" "full" How much motion this component uses: full (default) inherits the app's policy, subtle keeps feedback and drops the flourish, off stills it. It can only turn motion down — it never overrides a reader's reduce-motion setting. Under subtle the count updates in place and the badge fades in without the pop.

Variants

Tokens used

destructive, destructive-foreground, primary, primary-foreground, secondary, secondary-foreground

Motion

Accessibility

Related

Examples

Dot + counts

import { NotificationBadge, Row } from "@sableui/react"

<Row gap={3}><NotificationBadge dot /><NotificationBadge count={3} /><NotificationBadge count={128} /></Row>

Overlay on an icon button

import { Button, Icon, NotificationBadge } from "@sableui/react"

<Button variant="secondary" size="icon" aria-label="Notifications, 5 unread" className="relative"><Icon name="bell" /><NotificationBadge count={5} overlay /></Button>