Data display

Tag
v1.1.4
Ready for Production

A compact label component for categorization, status indication, and content organization with support for icons and remove buttons.

Prefer AI-assisted development?

This documentation is available via the Catalyst MCP Server. Learn how to connect →

Catalyst Tag is a compound component built on Radix UI primitives that provides a compact, visually distinct label for categorizing content or displaying status — with built-in design tokens, CVA variants, and accessibility defaults so you get a production-ready tag with zero configuration. Standalone tags include a TagButton for removal. Non-interactive tags are only used inside composed components such as Combobox Multi, where the parent handles removal via keyboard.

Preview
Tag

Installation

npm install @pmi/catalyst-tag
import { TagRoot, TagSlot, TagButton } from '@pmi/catalyst-tag';

Variants

Danger

Use the danger variant to indicate warnings, errors, or destructive actions.

Preview
Tag

Disabled

Disabled tags have reduced opacity. Pass disabled explicitly to TagButton to prevent removal — TagRoot does not propagate disabled to its children.

Preview
Tag

Common Patterns

Sizes

Tags are available in three sizes: sm, md, and lg.

Preview
Tag
Tag
Tag

AsChild

Use the asChild prop to merge tag props onto a child element such as a Button. Note: do not add TagButton when using asChild with a Button — nesting interactive elements is invalid HTML.

Preview

API Reference

Tag is a compound component. The sections below summarize the API surface for each part of the component.

TagRoot

The container component that manages tag state and appearance.

Prop

Type

TagSlot

A flexible slot for icons or custom leading content.

Accepts asChild, className, and children. Use asChild to merge slot props onto a custom element.

TagButton

An optional button for close or remove functionality.

Prop

Type

Accessibility

Tag is designed to meet WCAG 2.2 AA standards.

Keyboard Interactions

KeyAction
TabMoves focus to TagButton
EnterActivates TagButton (fires onClick)
SpaceActivates TagButton (fires onClick)
Tab (disabled TagRoot)Skipped — tabIndex={-1} is applied automatically to disabled tags

ARIA attributes

  • TagRoot renders as a div by default. When used in a list of removable tags, wrap the collection in a ul and use asChild with an li element for proper list semantics.
  • TagButton renders as a native button, providing built-in keyboard operability (Tab to focus, Enter or Space to activate) and screen reader announcement.
  • Set tabIndex={-1} on TagRoot when it contains a TagButton to ensure only the button receives focus and avoid redundant tab stops.
  • Disabled tags set tabIndex={-1} automatically, removing them from the tab order.
  • Provide an aria-label on TagButton when its visible content is an icon only (e.g. aria-label="Remove tag").

See the Radix Slot accessibility docs for inherited baseline behavior when using asChild.

Choosing the Right Component

Use Tag when you need a compact, styled label for categorization or status. Reach for a different primitive when:

If you need...Use instead
Numeric count or status dot indicatorsBadge
A full-width or high-emphasis action elementButton

On this page