Collections

Tag Group

A collection of tags displayed together, allowing users to categorize, filter, or manage multiple labels efficiently. It supports dynamic tag management.

Loading...

Installation

Install the component via the CLI in one command.

npx shadcn@latest add @intentui/tag-group

Composed components

When you install this component via the CLI, it automatically loads all composed components, so you don’t need to add them individually.

Manual installation

Use this approach if you prefer to install and wire up the component yourself instead of using the CLI.

npm install react-aria-components @heroicons/react tailwind-merge

Anatomy

import { Tag, TagGroup, TagList } from "@/components/ui/tag-group"
import { Label } from "@/components/ui/field"
<TagGroup selectionMode="multiple">
  <Label>Serverless</Label>
  <TagList>
    <Tag>AWS Lambda</Tag>
    <Tag>Google Cloud Functions</Tag>
    <Tag>Azure Functions</Tag>
  </TagList>
</TagGroup>

Examples

With remove button

Tags within the group can include a removal button.

Loading...

Controlled

Manage the values of the tag group through the value prop.

Loading...

Incorporate a hyperlink within the tag group using the href prop.

Loading...

For client-side routing, React Aria recommends using the onAction event to handle navigation programmatically instead of passing an href prop. This is because some collection items cannot be rendered as native elements due to HTML specification limitations.

Disabled

Disable tags either by setting the isDisabled prop or using disabledKeys on the TagGroup.

Loading...

Component API

Tag

The Tag component renders one tag item.

PropTypeDefault
classNamestring-

TagGroup

The TagGroup component groups related tags.

PropTypeDefault
classNamestring-

TagList

The TagList component contains tag items.

PropTypeDefault
classNamestring-

See the React Aria for the full API reference.

Unlock the full power of
Intent UI Design

Build modern web apps faster with 1000+ resources across components, blocks, patterns, templates, and starter kits.

Learn more