Skip to main content

Tag Group

A container for displaying and managing multiple tags together. Use when content can carry multiple simultaneous tag values. Don't use when only one tag value is possible.

Figma Storybook Docs

Description

What it does

Renders a horizontal or wrapping set of tag items that represent simultaneous categorical attributes of a record or piece of content. Tags may be read-only labels or interactive (removable, selectable, or linkable) depending on context.

Where it appears

Stakeholder profile cards (engagement topics, organisation types), consultation detail pages (theme labels, submission categories), community post listings (topic tags), and filter summaries in search interfaces.

Why it exists

Government records frequently carry multiple classifications at once — a stakeholder can belong to several sectors, and a consultation submission can address multiple themes. A single tag component handles one label; Tag Group provides the layout and interaction model for the whole set, ensuring consistent spacing, overflow handling, and keyboard navigation across both products.

Dependencies

Tag, Badge, Filter Chip

Anatomy

PartRequired?Notes
Group container Required A wrapping flex container that holds all tag items. Controls gap, wrap behaviour, and provides the ARIA group role with an accessible label.
Tag item Required Individual wa-tag elements inside the group. Each carries a visible label and an optional icon or avatar prefix.
Remove button (per tag) Optional A dismiss icon inside each tag. Present when the group is editable and the user can remove individual values. Must have its own accessible label.
Overflow indicator Optional A +N badge or truncated count shown when the full set of tags exceeds the available horizontal space. Expands the group on activation.
Add trigger Optional An inline button or combobox at the end of the group for adding new tag values. Used in editable contexts such as tagging a stakeholder record.

Variants

Read-only

Static informational labels; no interaction beyond potential linking.

Display-only contexts such as a stakeholder profile summary or a consultation card in a listing view.

Removable

Each tag can be dismissed individually, editing the underlying data set.

Editable forms where a user has already selected multiple values (e.g. assigning topics to a stakeholder) and needs to remove specific ones.

Selectable

Tags act as toggleable filter chips; selected state is visually distinct.

Inline filter bars on search or listing pages where the user activates/deactivates category filters without leaving the page.

Linked

Each tag is a hyperlink that navigates to a filtered view or a taxonomy detail page.

Consultation theme tags that navigate to a filtered submission list, or sector tags on a stakeholder that navigate to a sector roster.

States

State Behaviour
Default Tags render at rest with their configured colour and label. Group container has no visible border.
Tag hovered The individual tag under the pointer receives a subtle background shift using --op-color-interactive-hover. Cursor changes to pointer for interactive variants.
Tag focused 3px focus ring in --op-color-interactive-focus appears on the focused tag item or its remove button. No other visual change. Focus is managed sequentially through items using Tab.
Tag removed (transition) On remove button activation the tag collapses with a short fade-out (150ms). If prefers-reduced-motion is set, the tag disappears instantly. Group reflows remaining tags.
Overflow (collapsed) When the group is constrained in width and tags exceed available space, tags beyond the fold are hidden and an overflow indicator (+N) is shown.
Overflow (expanded) User activates the overflow indicator; all tags are revealed in a wrapped layout. The indicator changes to a 'Show less' control.
Empty When all tags have been removed, the group container either disappears or shows a placeholder message depending on the implementation context.
Disabled All interactive controls (remove buttons, add trigger) are non-interactive and visually muted at reduced opacity. Read-only tags remain visible.

Usage guidelines

When to use

  • A record can belong to multiple categories simultaneously — for example, a stakeholder tagged with both 'Industry' and 'Environment' sectors.
  • A user needs to review and edit a set of applied filters or category values without opening a separate form.
  • A consultation submission is labelled with multiple theme tags and those labels must be scannable at a glance.
  • A community post carries topic tags that link to filtered listing views.

When not to use

  • Only one value is possible at a time — use a Badge or a single Tag instead.
  • The values represent a status or severity — use a Status Badge so the semantic colour conveys meaning correctly.
  • There are more than ~12 possible values in a flat list — use a multi-select input with search to avoid an overwhelming tag cloud.
  • Tags need to communicate a hierarchical relationship — use a Breadcrumb or nested navigation instead.

Do / Don't

Do

Give the group container an accessible label that describes what the tags represent (e.g. aria-label='Engagement topics').

Don't

Rely on surrounding visual layout to imply what the tags mean — screen readers need an explicit label.

Do

Keep individual tag labels short (1–3 words). Truncate with a tooltip if the source value is longer.

Don't

Wrap long sentences inside a tag; this breaks visual scanning and overflows layouts on small screens.

Do

Use the removable variant only when the action has a clear save path — either auto-save or a visible Save button nearby.

Don't

Show remove buttons on tags in a read-only summary view where the user cannot actually change the data.

Do

When a tag group is empty after all items are removed, provide a visible empty state or hide the group gracefully.

Don't

Leave an invisible group container in the DOM — it confuses screen reader users who tab into empty space.

Do

Ensure colour is not the sole differentiator between tag variants. Combine colour with a shape or prefix icon where semantics differ.

Don't

Use raw hex colours or non-token values for tag backgrounds; always pull from --op-color-* tokens.

Was this page helpful?

Updated 9 September 2026