Skip to content

Tag Group

The Tag Group component is a focusable container that holds and manages multiple Tag elements, with built-in support for keyboard navigation, selection, and removal.

  • Manage sets of related tags where users need to view, select, or remove multiple items (e.g., active filters, selected keywords, categorized content).
  • Provide unified keyboard navigation and focus management across tags.
  • Display dynamic or static collections requiring accessibility features like roving focus.
  • Removable filter pills: Tags representing active filters with individual close buttons.
  • Selectable tags: Tags that support single or multiple selection (e.g., for categorization or multi-select inputs).
  • Static tag lists: Non-interactive or non-removable tags with keyboard navigation for screen readers.
  • For a single tag; use the Tag component instead.
  • For simple non-interactive displays without keyboard navigation needs; use a basic container.
  • When tags require independent focus management outside a unified group.
VariantUse Case
None (default)Display tags with optional individual removal
SingleAllow selection of exactly one tag
MultipleAllow selection of one or more tags
ElementDescription
ContainerFocusable wrapper managing the overall group.
LabelAccessible name for the group (visible or via aria-label).
Tag ListLayout container for the collection of Tag items.
TagsIndividual Tag components within the group.
DescriptionOptional helper text below the tag list.
Error MessageOptional validation error text.
StateDescriptionVisual Indicators
EmptyNo tags presentRender empty state content if provided
FocusedKeyboard focus (visible on Tab or arrow key navigation)High-contrast focus ring on active tag
ErrorValidation error stateError message displayed, potential red styling
  • Provide a clear, concise label describing the group’s purpose (e.g., “Selected filters” or “Keywords”).
  • Ensure individual tag labels remain concise and consistent with Tag guidelines.
  • For empty states, use neutral messaging like “No items selected”.
  • Always provide an accessible label via visible text or aria-label/aria-labelledby.
  • For selectable variants: Use role="listbox" with aria-multiselectable="true" for multiple selection.
  • For non-selectable: Use role="group" or appropriate list structure.
  • Ensure each tag has a textValue for non-text content and unique keys for dynamic collections.
  • Support roving tabindex for keyboard focus movement across tags.
  • Announce changes (e.g., removal, selection) dynamically if needed.

Support standard keyboard navigation

  • Tab: Focus the group; subsequent arrows move focus internally.
  • Arrow Left/Right: Move focus between tags (roving focus).
  • Home/End: Jump to first/last tag.
  • Space/Enter: Toggle selection on focused tag (in selectable variants).
  • Delete/Backspace: Remove focused tag (if removal allowed).
  • Escape: Optionally clear selection (configurable behavior).
  • Type-ahead: Jump to tags matching typed characters.