Badge

Badges show notifications, counts, or status information on navigation items and icons.

Props

React props
NameTypeRequiredDefaultDescription
labelstring | numberNoText shown inside the badge. Omitted, the badge renders as the small dot Material 3 uses for an unread notification. Material limits badge content to four characters including a `+`; use `max` to keep a count within that.
maxnumberNoCaps a numeric `label`. A label of 100 with `max` 99 renders `99+`. Ignored when `label` is not a number.
descriptionstringNoWhat assistive technology announces for the badge, such as `3 unread messages`. The visible label is rarely enough on its own -- `3` says nothing about what there are three of -- and the small dot has no text at all, so this is the only way it reaches a screen reader.
visiblebooleanNotrueWhether the badge is shown. Default: `true`. Set it to `false` rather than unmounting the badge, so it can animate out; it stays in the DOM, invisible and hidden from assistive technology, until it is shown again. Material recommends clearing a badge once its destination has been viewed.
transitionBadgeTransitionNoAnime.js show-hide timing.
classNamestring | Partial<Record<"container" | "label" | "badge" | "announcement", string>> | ClassNameComponent<BadgeInterface>NoRoot classes (string), static element classes (object), or state-aware element classes (function).
childrenReactNodeNoThe icon or item the badge is anchored to.