Skip to content

Badge

A small dot or a short count or label, placed on an anchor with BadgedBox.

import { Badge, BadgedBox } from '@windmorph/react';

Purpose

A badge marks an item as having new or unread content — a small dot for a plain signal, or a large badge carrying a short count or label. Place it on an icon with BadgedBox, for example on a navigation icon or an icon button.

A Badge with no children is the small dot; with children it is the large badge. Keep large badges to four characters, including a "+": numbers are capped at max (999 by default, so "999+"), and longer text is truncated at the badge's maximum width (34px at the default text size, growing with larger text).

When not to use

For a status that needs a label and context, use a Chip or inline text.

See also

  • Badge on m3.material.io: Material's own guidelines, with anatomy and specs.
  • Navigation bar: 3–5 destinations along the bottom of compact and medium windows, stacked or inline.
  • Icon button: A compact icon-only action; requires an accessible name.