Skip to content

Tag

Pro

A small, static label for a status or category: Sold, Open now, Featured. Tonal, filled or outlined, in M3, success and warning colours. Not an M3 component (@windmorph/react-pro).

import { Tag, TagGroup } from '@windmorph/react-pro';

Part of Windmorph Pro, paid components on the free core, not on sale yet. See the Pro guide for what it includes and to register interest.

Keyboard

Tag keyboard
KeyAction
TabReaches a tag only while its visible text is shorter than its full text (a fullLabel, or a label cut short at maxWidth), and shows the full text in a tooltip. Any other tag is skipped.
EscapeHides the tooltip.On a focused tag

Screen reader

Role
None: a tag is a plain span read as text. TagGroup is a list (ul): each child, a Tag or text, is one list item.
Accessible name
Its label, or fullLabel in its place when the label is short ("M3E" reads "Expressive"). A TagGroup is named by its aria-label.
States announced
None. In a TagGroup, screen readers say how many tags the list holds.
  • The status dot and the leading icon are decorative and hidden from assistive tech (aria-hidden).
  • The tooltip of a short or cut tag is the core's plain tooltip, linked to the tag as its description (aria-describedby) while it shows.

Focus

A tag takes focus only to show its full text (a fullLabel, or a label cut at maxWidth), with M3's focus indicator on keyboard focus; otherwise it never takes focus. A TagGroup adds no focus stops of its own.

Touch target

  • A tag has nothing to press. Its height (20, 24 or 32px, a minimum that grows with larger text) is not a touch target.
  • A small (sm) tag that takes focus for its tooltip gets a 24px touch target around its label (WCAG 2.5.8), so a long press opens the tooltip; its layout size stays the same.

Motion

Colours ease on the default effects spring when the variant or colour changes, and change at once under reduced motion.

What you need to do

  • Let the label carry the meaning: the dot and the colour are not read, so "Open now" must say it in words.
  • Pass fullLabel for an abbreviation; it replaces the short label for screen readers and shows in a tooltip on hover, keyboard focus or a long press. A label cut by maxWidth shows its full text the same way.
  • Give TagGroup an aria-label that says what the tags describe ("Job details").
  • Use AssistChip or FilterChip when it should do something when pressed, and Badge for a count.
  • In forced-colours mode every tag keeps a border and its dot uses the system text colour; keep classNames overrides from removing them.