Tag
ProA 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
| Key | Action | Where |
|---|---|---|
| Tab | Reaches 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. | |
| Escape | Hides the tooltip.On a focused tag | On a focused tag |
Screen reader
- Role
- None: a tag is a plain
spanread as text.TagGroupis a list (ul): each child, aTagor text, is one list item. - Accessible name
- Its label, or
fullLabelin its place when the label is short ("M3E" reads "Expressive"). ATagGroupis named by itsaria-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
fullLabelfor 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 bymaxWidthshows its full text the same way. - Give
TagGroupanaria-labelthat says what the tags describe ("Job details"). - Use
AssistChiporFilterChipwhen it should do something when pressed, andBadgefor a count. - In forced-colours mode every tag keeps a border and its dot uses the system text colour; keep
classNamesoverrides from removing them.