---
title: "Tag Group"
description: "A row of tags that people can read, remove, pick as filters, or open as links. The arrow keys move from tag to tag."
url: https://gelatinui.com/components/tag-group
markdown_url: https://gelatinui.com/components/tag-group.md
access: free
install: "npx shadcn@latest add @gelatin-ui/tag-group"
registry_item: https://gelatinui.com/r/tag-group.json
version: "2026-11-09"
index: https://gelatinui.com/llms.txt
docs_index: https://gelatinui.com/docs/llms.txt
---

# Tag Group

> A row of tags that people can read, remove, pick as filters, or open as links. The arrow keys move from tag to tag.

Page: https://gelatinui.com/components/tag-group

## When to use it

Best for: A focusable set of tags to read, remove, pick as filters, or open as links.

- Use it for a set of tags with one tab stop and arrow keys between them.
- Use `selectionMode` (`single` or `multiple`) for filter chips.
- Use `onRemove` to add the remove button and the Delete and Backspace keys.
- Use `href` on a tag to make it a link.

## When not to use it

- When people type new values, use a [Tags Input](https://gelatinui.com/components/tags-input.md).
- For one status label with no action, use a [Badge](https://gelatinui.com/components/badge.md).

## Notes for agents

- Compose the parts: `TagGroupLabel`, `TagGroupList`, and `TagGroupTag`.
- `TagGroupList` takes static children, or `items` with a function child.
- A string child sets `textValue`. Set `textValue` yourself when the child is not a string.
- A function child of `TagGroupTag` renders only what it returns. Add `TagGroupTagRemove` yourself then.
- A Tag Group has no validation of its own. Render `TagGroupError` when your form rule fails, and leave it out when it passes.
- `renderEmptyState` on `TagGroupList` shows a line in place of the tags.
- In an app with a client router, wrap the app in React Aria `RouterProvider` with the router `navigate`.

## Anatomy

```text
TagGroup
├─ TagGroupLabel (0..n)
├─ TagGroupList (0..n)
├─ TagGroupTag (0..n)
├─ TagGroupTagRemove (0..n)
├─ TagGroupDescription (0..n)
└─ TagGroupError (0..n)
```

## API reference

### TagGroup

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `aria-label` | `string` |  | Defines a string value that labels the current element. |
| `aria-labelledby` | `string` |  | Identifies the element (or elements) that labels the current element. |
| `aria-describedby` | `string` |  | Identifies the element (or elements) that describes the object. |
| `aria-details` | `string` |  | Identifies the element (or elements) that provide a detailed, extended description for the object. |
| `id` | `string` |  | The element's unique identifier. See MDN. |
| `dir` | `string` |  |  |
| `lang` | `string` |  |  |
| `hidden` | `boolean` |  |  |
| `inert` | `boolean` |  |  |
| `translate` | `"no" \| "yes"` |  |  |
| `suppressHydrationWarning` | `boolean` |  | A React-only flag that suppresses the warning React normally logs when an element's server-rendered content doesn't match the client render during hydration. See React docs. |
| `onClick` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onClickCapture` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onAuxClick` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onAuxClickCapture` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onContextMenu` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onContextMenuCapture` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onDoubleClick` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onDoubleClickCapture` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onMouseDown` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onMouseDownCapture` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onMouseEnter` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onMouseLeave` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onMouseMove` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onMouseMoveCapture` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onMouseOut` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onMouseOutCapture` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onMouseOver` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onMouseOverCapture` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onMouseUp` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onMouseUpCapture` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onTouchCancel` | `TouchEventHandler<HTMLDivElement>` |  |  |
| `onTouchCancelCapture` | `TouchEventHandler<HTMLDivElement>` |  |  |
| `onTouchEnd` | `TouchEventHandler<HTMLDivElement>` |  |  |
| `onTouchEndCapture` | `TouchEventHandler<HTMLDivElement>` |  |  |
| `onTouchMove` | `TouchEventHandler<HTMLDivElement>` |  |  |
| `onTouchMoveCapture` | `TouchEventHandler<HTMLDivElement>` |  |  |
| `onTouchStart` | `TouchEventHandler<HTMLDivElement>` |  |  |
| `onTouchStartCapture` | `TouchEventHandler<HTMLDivElement>` |  |  |
| `onPointerDown` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onPointerDownCapture` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onPointerMove` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onPointerMoveCapture` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onPointerUp` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onPointerUpCapture` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onPointerCancel` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onPointerCancelCapture` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onPointerEnter` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onPointerLeave` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onPointerOver` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onPointerOverCapture` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onPointerOut` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onPointerOutCapture` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onGotPointerCapture` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onGotPointerCaptureCapture` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onLostPointerCapture` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onLostPointerCaptureCapture` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onScroll` | `UIEventHandler<HTMLDivElement>` |  |  |
| `onScrollCapture` | `UIEventHandler<HTMLDivElement>` |  |  |
| `onWheel` | `WheelEventHandler<HTMLDivElement>` |  |  |
| `onWheelCapture` | `WheelEventHandler<HTMLDivElement>` |  |  |
| `onAnimationStart` | `AnimationEventHandler<HTMLDivElement>` |  |  |
| `onAnimationStartCapture` | `AnimationEventHandler<HTMLDivElement>` |  |  |
| `onAnimationEnd` | `AnimationEventHandler<HTMLDivElement>` |  |  |
| `onAnimationEndCapture` | `AnimationEventHandler<HTMLDivElement>` |  |  |
| `onAnimationIteration` | `AnimationEventHandler<HTMLDivElement>` |  |  |
| `onAnimationIterationCapture` | `AnimationEventHandler<HTMLDivElement>` |  |  |
| `onTransitionCancel` | `TransitionEventHandler<HTMLDivElement>` |  |  |
| `onTransitionCancelCapture` | `TransitionEventHandler<HTMLDivElement>` |  |  |
| `onTransitionEnd` | `TransitionEventHandler<HTMLDivElement>` |  |  |
| `onTransitionEndCapture` | `TransitionEventHandler<HTMLDivElement>` |  |  |
| `onTransitionRun` | `TransitionEventHandler<HTMLDivElement>` |  |  |
| `onTransitionRunCapture` | `TransitionEventHandler<HTMLDivElement>` |  |  |
| `onTransitionStart` | `TransitionEventHandler<HTMLDivElement>` |  |  |
| `onTransitionStartCapture` | `TransitionEventHandler<HTMLDivElement>` |  |  |
| `selectionMode` | `SelectionMode` |  | The type of selection that is allowed in the collection. |
| `disallowEmptySelection` | `boolean` |  | Whether the collection allows empty selection. |
| `disabledKeys` | `Iterable<Key>` |  | The item keys that are disabled. These items cannot be selected, focused, or otherwise interacted with. |
| `style` | `CSSProperties` |  | The inline style for the element. |
| `children` | `ReactNode` |  | The children of the component. |
| `slot` | `string \| null` |  | A slot name for the component. Slots allow the component to receive props from a parent component. An explicit `null` value indicates that the local props completely override all props received from a parent. |
| `render` | `DOMRenderFunction<"div", undefined>` |  | Overrides the default DOM element with a custom render function. This allows rendering existing components with built-in styles and behaviors such as router links, animation libraries, and pre-styled components. Requirements: - You must render the expected element type (e.g. if `<button>` is expected, you cannot render an `<a>`). - Only a single root DOM element can be rendered (no fragments). - You must pass through props and ref to the underlying DOM element, merging with your own prop as appropriate. |
| `onAction` | `function` |  | Handler that is called when a user performs an action on an item. The exact user event depends on the collection's `selectionBehavior` prop and the interaction modality. |
| `selectionBehavior` | `SelectionBehavior` | 'toggle' | How multiple selection should behave in the collection. |
| `shouldSelectOnPressUp` | `boolean` |  | Whether selection should occur on press up instead of press down. |
| `onRemove` | `function` |  | Handler that is called when a user deletes a tag. |
| `escapeKeyBehavior` | `"clearSelection" \| "none"` | 'clearSelection' | Whether pressing the escape key should clear selection in the TagGroup or not. Most experiences should not modify this option as it eliminates a keyboard user's ability to easily clear selection. Only use if the escape key is being handled externally or should not trigger selection clearing contextually. |
| `value` | `"all" \| Iterable<Key>` |  | The picked keys (controlled). |
| `defaultValue` | `"all" \| Iterable<Key>` |  | The picked keys at first (uncontrolled). |
| `onValueChange` | `function` |  | Runs on each change, with the new picked keys and the Base UI change details. |
| `className` | `string` |  |  |
| `size` | `"default" \| "lg" \| "sm"` | "default" | The tag height: `sm` 20px, `default` 24px (both 32px on touch), `lg` 28px (36px on touch), the chip sizes of `#/lib/chip`. |
| `rounded` | `"default" \| "full"` | "default" | The tag corner: `default` 6px, or `full`, a pill with a round ×. |

### TagGroupLabel

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `render` | `DOMRenderFunction<"label", undefined>` |  | Overrides the default DOM element with a custom render function. This allows rendering existing components with built-in styles and behaviors such as router links, animation libraries, and pre-styled components. Requirements: - You must render the expected element type (e.g. if `<button>` is expected, you cannot render an `<a>`). - Only a single root DOM element can be rendered (no fragments). - You must pass through props and ref to the underlying DOM element, merging with your own prop as appropriate. |
| `elementType` | `string` |  |  |
| `className` | `string` |  |  |

### TagGroupList

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `dir` | `string` |  |  |
| `lang` | `string` |  |  |
| `hidden` | `boolean` |  |  |
| `inert` | `boolean` |  |  |
| `translate` | `"no" \| "yes"` |  |  |
| `suppressHydrationWarning` | `boolean` |  | A React-only flag that suppresses the warning React normally logs when an element's server-rendered content doesn't match the client render during hydration. See React docs. |
| `onClick` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onClickCapture` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onAuxClick` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onAuxClickCapture` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onContextMenu` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onContextMenuCapture` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onDoubleClick` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onDoubleClickCapture` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onMouseDown` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onMouseDownCapture` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onMouseEnter` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onMouseLeave` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onMouseMove` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onMouseMoveCapture` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onMouseOut` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onMouseOutCapture` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onMouseOver` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onMouseOverCapture` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onMouseUp` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onMouseUpCapture` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onTouchCancel` | `TouchEventHandler<HTMLDivElement>` |  |  |
| `onTouchCancelCapture` | `TouchEventHandler<HTMLDivElement>` |  |  |
| `onTouchEnd` | `TouchEventHandler<HTMLDivElement>` |  |  |
| `onTouchEndCapture` | `TouchEventHandler<HTMLDivElement>` |  |  |
| `onTouchMove` | `TouchEventHandler<HTMLDivElement>` |  |  |
| `onTouchMoveCapture` | `TouchEventHandler<HTMLDivElement>` |  |  |
| `onTouchStart` | `TouchEventHandler<HTMLDivElement>` |  |  |
| `onTouchStartCapture` | `TouchEventHandler<HTMLDivElement>` |  |  |
| `onPointerDown` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onPointerDownCapture` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onPointerMove` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onPointerMoveCapture` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onPointerUp` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onPointerUpCapture` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onPointerCancel` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onPointerCancelCapture` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onPointerEnter` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onPointerLeave` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onPointerOver` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onPointerOverCapture` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onPointerOut` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onPointerOutCapture` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onGotPointerCapture` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onGotPointerCaptureCapture` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onLostPointerCapture` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onLostPointerCaptureCapture` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onScroll` | `UIEventHandler<HTMLDivElement>` |  |  |
| `onScrollCapture` | `UIEventHandler<HTMLDivElement>` |  |  |
| `onWheel` | `WheelEventHandler<HTMLDivElement>` |  |  |
| `onWheelCapture` | `WheelEventHandler<HTMLDivElement>` |  |  |
| `onAnimationStart` | `AnimationEventHandler<HTMLDivElement>` |  |  |
| `onAnimationStartCapture` | `AnimationEventHandler<HTMLDivElement>` |  |  |
| `onAnimationEnd` | `AnimationEventHandler<HTMLDivElement>` |  |  |
| `onAnimationEndCapture` | `AnimationEventHandler<HTMLDivElement>` |  |  |
| `onAnimationIteration` | `AnimationEventHandler<HTMLDivElement>` |  |  |
| `onAnimationIterationCapture` | `AnimationEventHandler<HTMLDivElement>` |  |  |
| `onTransitionCancel` | `TransitionEventHandler<HTMLDivElement>` |  |  |
| `onTransitionCancelCapture` | `TransitionEventHandler<HTMLDivElement>` |  |  |
| `onTransitionEnd` | `TransitionEventHandler<HTMLDivElement>` |  |  |
| `onTransitionEndCapture` | `TransitionEventHandler<HTMLDivElement>` |  |  |
| `onTransitionRun` | `TransitionEventHandler<HTMLDivElement>` |  |  |
| `onTransitionRunCapture` | `TransitionEventHandler<HTMLDivElement>` |  |  |
| `onTransitionStart` | `TransitionEventHandler<HTMLDivElement>` |  |  |
| `onTransitionStartCapture` | `TransitionEventHandler<HTMLDivElement>` |  |  |
| `items` | `Iterable<T>` |  | Item objects in the collection. |
| `style` | `StyleOrFunction<TagListRenderProps>` |  | The inline style for the element. A function may be provided to compute the style based on component state. |
| `render` | `DOMRenderFunction` |  | Overrides the default DOM element with a custom render function. This allows rendering existing components with built-in styles and behaviors such as router links, animation libraries, and pre-styled components. Requirements: - You must render the expected element type (e.g. if `<button>` is expected, you cannot render an `<a>`). - Only a single root DOM element can be rendered (no fragments). - You must pass through props and ref to the underlying DOM element, merging with your own prop as appropriate. |
| `children` | `((item: T) => ReactNode) \| ReactNode` |  | The contents of the collection. |
| `dependencies` | `readonly any[]` |  | Values that should invalidate the item cache when using dynamic collections. |
| `renderEmptyState` | `function` |  | Provides content to display when there are no items in the tag list. |
| `className` | `string` |  |  |
| `ref` | `Ref<HTMLDivElement>` |  |  |

### TagGroupTag

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `href` | `string` |  | A URL to link to. See MDN. |
| `hrefLang` | `string` |  | Hints at the human language of the linked URL. SeeMDN. |
| `target` | `HTMLAttributeAnchorTarget` |  | The target window for the link. See MDN. |
| `rel` | `string` |  | The relationship between the linked resource and the current page. See MDN. |
| `download` | `string \| boolean` |  | Causes the browser to download the linked URL. A string may be provided to suggest a file name. See MDN. |
| `ping` | `string` |  | A space-separated list of URLs to ping when the link is followed. See MDN. |
| `referrerPolicy` | `HTMLAttributeReferrerPolicy` |  | How much of the referrer to send when following the link. See MDN. |
| `routerOptions` | `` |  | Options for the configured client side router. |
| `dir` | `string` |  |  |
| `lang` | `string` |  |  |
| `hidden` | `boolean` |  |  |
| `inert` | `boolean` |  |  |
| `translate` | `"no" \| "yes"` |  |  |
| `suppressHydrationWarning` | `boolean` |  | A React-only flag that suppresses the warning React normally logs when an element's server-rendered content doesn't match the client render during hydration. See React docs. |
| `onClickCapture` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onAuxClick` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onAuxClickCapture` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onContextMenu` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onContextMenuCapture` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onDoubleClick` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onDoubleClickCapture` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onMouseDown` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onMouseDownCapture` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onMouseEnter` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onMouseLeave` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onMouseMove` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onMouseMoveCapture` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onMouseOut` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onMouseOutCapture` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onMouseOver` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onMouseOverCapture` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onMouseUp` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onMouseUpCapture` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onTouchCancel` | `TouchEventHandler<HTMLDivElement>` |  |  |
| `onTouchCancelCapture` | `TouchEventHandler<HTMLDivElement>` |  |  |
| `onTouchEnd` | `TouchEventHandler<HTMLDivElement>` |  |  |
| `onTouchEndCapture` | `TouchEventHandler<HTMLDivElement>` |  |  |
| `onTouchMove` | `TouchEventHandler<HTMLDivElement>` |  |  |
| `onTouchMoveCapture` | `TouchEventHandler<HTMLDivElement>` |  |  |
| `onTouchStart` | `TouchEventHandler<HTMLDivElement>` |  |  |
| `onTouchStartCapture` | `TouchEventHandler<HTMLDivElement>` |  |  |
| `onPointerDown` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onPointerDownCapture` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onPointerMove` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onPointerMoveCapture` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onPointerUp` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onPointerUpCapture` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onPointerCancel` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onPointerCancelCapture` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onPointerEnter` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onPointerLeave` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onPointerOver` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onPointerOverCapture` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onPointerOut` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onPointerOutCapture` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onGotPointerCapture` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onGotPointerCaptureCapture` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onLostPointerCapture` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onLostPointerCaptureCapture` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onScroll` | `UIEventHandler<HTMLDivElement>` |  |  |
| `onScrollCapture` | `UIEventHandler<HTMLDivElement>` |  |  |
| `onWheel` | `WheelEventHandler<HTMLDivElement>` |  |  |
| `onWheelCapture` | `WheelEventHandler<HTMLDivElement>` |  |  |
| `onAnimationStart` | `AnimationEventHandler<HTMLDivElement>` |  |  |
| `onAnimationStartCapture` | `AnimationEventHandler<HTMLDivElement>` |  |  |
| `onAnimationEnd` | `AnimationEventHandler<HTMLDivElement>` |  |  |
| `onAnimationEndCapture` | `AnimationEventHandler<HTMLDivElement>` |  |  |
| `onAnimationIteration` | `AnimationEventHandler<HTMLDivElement>` |  |  |
| `onAnimationIterationCapture` | `AnimationEventHandler<HTMLDivElement>` |  |  |
| `onTransitionCancel` | `TransitionEventHandler<HTMLDivElement>` |  |  |
| `onTransitionCancelCapture` | `TransitionEventHandler<HTMLDivElement>` |  |  |
| `onTransitionEnd` | `TransitionEventHandler<HTMLDivElement>` |  |  |
| `onTransitionEndCapture` | `TransitionEventHandler<HTMLDivElement>` |  |  |
| `onTransitionRun` | `TransitionEventHandler<HTMLDivElement>` |  |  |
| `onTransitionRunCapture` | `TransitionEventHandler<HTMLDivElement>` |  |  |
| `onTransitionStart` | `TransitionEventHandler<HTMLDivElement>` |  |  |
| `onTransitionStartCapture` | `TransitionEventHandler<HTMLDivElement>` |  |  |
| `onFocus` | `function` |  | Handler that is called when the element receives focus. |
| `onBlur` | `function` |  | Handler that is called when the element loses focus. |
| `onFocusChange` | `function` |  | Handler that is called when the element's focus status changes. |
| `onHoverStart` | `function` |  | Handler that is called when a hover interaction starts. |
| `onHoverEnd` | `function` |  | Handler that is called when a hover interaction ends. |
| `onHoverChange` | `function` |  | Handler that is called when the hover state changes. |
| `onPress` | `function` |  | Handler that is called when the press is released over the target. |
| `onPressStart` | `function` |  | Handler that is called when a press interaction starts. |
| `onPressEnd` | `function` |  | Handler that is called when a press interaction ends, either over the target or when the pointer leaves the target. |
| `onPressChange` | `function` |  | Handler that is called when the press state changes. |
| `onPressUp` | `function` |  | Handler that is called when a press is released over the target, regardless of whether it started on the target or not. |
| `onClick` | `function` |  | **Not recommended – use `onPress` instead.** `onClick` is an alias for `onPress` provided for compatibility with other libraries. `onPress` provides additional event details for non-mouse interactions. |
| `style` | `StyleOrFunction<TagRenderProps>` |  | The inline style for the element. A function may be provided to compute the style based on component state. |
| `children` | `ChildrenOrFunction<TagRenderProps>` |  | The children of the component. A function may be provided to alter the children based on component state. |
| `render` | `DOMRenderFunction<"div", TagRenderProps>` |  | Overrides the default DOM element with a custom render function. This allows rendering existing components with built-in styles and behaviors such as router links, animation libraries, and pre-styled components. Requirements: - You must render the expected element type (e.g. if `<button>` is expected, you cannot render an `<a>`). - Only a single root DOM element can be rendered (no fragments). - You must pass through props and ref to the underlying DOM element, merging with your own prop as appropriate. |
| `id` | `Key` |  | A unique id for the tag. |
| `textValue` | `string` |  | A string representation of the tags's contents, used for accessibility. Required if children is not a plain text string. |
| `onAction` | `function` |  | Handler that is called when a user performs an action on the item. The exact user event depends on the collection's `selectionBehavior` prop and the interaction modality. |
| `disabled` | `boolean` |  | Turns off the control: no focus, no edits, and the disabled look. |
| `className` | `string` |  |  |
| `ref` | `Ref<HTMLDivElement>` |  |  |

### TagGroupTagRemove

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `aria-label` | `string` |  | Defines a string value that labels the current element. |
| `aria-labelledby` | `string` |  | Identifies the element (or elements) that labels the current element. |
| `aria-describedby` | `string` |  | Identifies the element (or elements) that describes the object. |
| `aria-details` | `string` |  | Identifies the element (or elements) that provide a detailed, extended description for the object. |
| `id` | `string` |  | The element's unique identifier. See MDN. |
| `excludeFromTabOrder` | `boolean` |  | Whether to exclude the element from the sequential tab order. If true, the element will not be focusable via the keyboard by tabbing. This should be avoided except in rare scenarios where an alternative means of accessing the element or its functionality via the keyboard is available. |
| `dir` | `string` |  |  |
| `lang` | `string` |  |  |
| `hidden` | `boolean` |  |  |
| `inert` | `boolean` |  |  |
| `translate` | `"no" \| "yes"` |  |  |
| `suppressHydrationWarning` | `boolean` |  | A React-only flag that suppresses the warning React normally logs when an element's server-rendered content doesn't match the client render during hydration. See React docs. |
| `onClickCapture` | `MouseEventHandler<HTMLButtonElement>` |  |  |
| `onAuxClick` | `MouseEventHandler<HTMLButtonElement>` |  |  |
| `onAuxClickCapture` | `MouseEventHandler<HTMLButtonElement>` |  |  |
| `onContextMenu` | `MouseEventHandler<HTMLButtonElement>` |  |  |
| `onContextMenuCapture` | `MouseEventHandler<HTMLButtonElement>` |  |  |
| `onDoubleClick` | `MouseEventHandler<HTMLButtonElement>` |  |  |
| `onDoubleClickCapture` | `MouseEventHandler<HTMLButtonElement>` |  |  |
| `onMouseDown` | `MouseEventHandler<HTMLButtonElement>` |  |  |
| `onMouseDownCapture` | `MouseEventHandler<HTMLButtonElement>` |  |  |
| `onMouseEnter` | `MouseEventHandler<HTMLButtonElement>` |  |  |
| `onMouseLeave` | `MouseEventHandler<HTMLButtonElement>` |  |  |
| `onMouseMove` | `MouseEventHandler<HTMLButtonElement>` |  |  |
| `onMouseMoveCapture` | `MouseEventHandler<HTMLButtonElement>` |  |  |
| `onMouseOut` | `MouseEventHandler<HTMLButtonElement>` |  |  |
| `onMouseOutCapture` | `MouseEventHandler<HTMLButtonElement>` |  |  |
| `onMouseOver` | `MouseEventHandler<HTMLButtonElement>` |  |  |
| `onMouseOverCapture` | `MouseEventHandler<HTMLButtonElement>` |  |  |
| `onMouseUp` | `MouseEventHandler<HTMLButtonElement>` |  |  |
| `onMouseUpCapture` | `MouseEventHandler<HTMLButtonElement>` |  |  |
| `onTouchCancel` | `TouchEventHandler<HTMLButtonElement>` |  |  |
| `onTouchCancelCapture` | `TouchEventHandler<HTMLButtonElement>` |  |  |
| `onTouchEnd` | `TouchEventHandler<HTMLButtonElement>` |  |  |
| `onTouchEndCapture` | `TouchEventHandler<HTMLButtonElement>` |  |  |
| `onTouchMove` | `TouchEventHandler<HTMLButtonElement>` |  |  |
| `onTouchMoveCapture` | `TouchEventHandler<HTMLButtonElement>` |  |  |
| `onTouchStart` | `TouchEventHandler<HTMLButtonElement>` |  |  |
| `onTouchStartCapture` | `TouchEventHandler<HTMLButtonElement>` |  |  |
| `onPointerDown` | `PointerEventHandler<HTMLButtonElement>` |  |  |
| `onPointerDownCapture` | `PointerEventHandler<HTMLButtonElement>` |  |  |
| `onPointerMove` | `PointerEventHandler<HTMLButtonElement>` |  |  |
| `onPointerMoveCapture` | `PointerEventHandler<HTMLButtonElement>` |  |  |
| `onPointerUp` | `PointerEventHandler<HTMLButtonElement>` |  |  |
| `onPointerUpCapture` | `PointerEventHandler<HTMLButtonElement>` |  |  |
| `onPointerCancel` | `PointerEventHandler<HTMLButtonElement>` |  |  |
| `onPointerCancelCapture` | `PointerEventHandler<HTMLButtonElement>` |  |  |
| `onPointerEnter` | `PointerEventHandler<HTMLButtonElement>` |  |  |
| `onPointerLeave` | `PointerEventHandler<HTMLButtonElement>` |  |  |
| `onPointerOver` | `PointerEventHandler<HTMLButtonElement>` |  |  |
| `onPointerOverCapture` | `PointerEventHandler<HTMLButtonElement>` |  |  |
| `onPointerOut` | `PointerEventHandler<HTMLButtonElement>` |  |  |
| `onPointerOutCapture` | `PointerEventHandler<HTMLButtonElement>` |  |  |
| `onGotPointerCapture` | `PointerEventHandler<HTMLButtonElement>` |  |  |
| `onGotPointerCaptureCapture` | `PointerEventHandler<HTMLButtonElement>` |  |  |
| `onLostPointerCapture` | `PointerEventHandler<HTMLButtonElement>` |  |  |
| `onLostPointerCaptureCapture` | `PointerEventHandler<HTMLButtonElement>` |  |  |
| `onScroll` | `UIEventHandler<HTMLButtonElement>` |  |  |
| `onScrollCapture` | `UIEventHandler<HTMLButtonElement>` |  |  |
| `onWheel` | `WheelEventHandler<HTMLButtonElement>` |  |  |
| `onWheelCapture` | `WheelEventHandler<HTMLButtonElement>` |  |  |
| `onAnimationStart` | `AnimationEventHandler<HTMLButtonElement>` |  |  |
| `onAnimationStartCapture` | `AnimationEventHandler<HTMLButtonElement>` |  |  |
| `onAnimationEnd` | `AnimationEventHandler<HTMLButtonElement>` |  |  |
| `onAnimationEndCapture` | `AnimationEventHandler<HTMLButtonElement>` |  |  |
| `onAnimationIteration` | `AnimationEventHandler<HTMLButtonElement>` |  |  |
| `onAnimationIterationCapture` | `AnimationEventHandler<HTMLButtonElement>` |  |  |
| `onTransitionCancel` | `TransitionEventHandler` |  |  |
| `onTransitionCancelCapture` | `TransitionEventHandler` |  |  |
| `onTransitionEnd` | `TransitionEventHandler` |  |  |
| `onTransitionEndCapture` | `TransitionEventHandler` |  |  |
| `onTransitionRun` | `TransitionEventHandler` |  |  |
| `onTransitionRunCapture` | `TransitionEventHandler` |  |  |
| `onTransitionStart` | `TransitionEventHandler` |  |  |
| `onTransitionStartCapture` | `TransitionEventHandler` |  |  |
| `onKeyDown` | `function` |  | Handler that is called when a key is pressed. |
| `onKeyUp` | `function` |  | Handler that is called when a key is released. |
| `onFocus` | `function` |  | Handler that is called when the element receives focus. |
| `onBlur` | `function` |  | Handler that is called when the element loses focus. |
| `onFocusChange` | `function` |  | Handler that is called when the element's focus status changes. |
| `onHoverStart` | `function` |  | Handler that is called when a hover interaction starts. |
| `onHoverEnd` | `function` |  | Handler that is called when a hover interaction ends. |
| `onHoverChange` | `function` |  | Handler that is called when the hover state changes. |
| `onPress` | `function` |  | Handler that is called when the press is released over the target. |
| `onPressStart` | `function` |  | Handler that is called when a press interaction starts. |
| `onPressEnd` | `function` |  | Handler that is called when a press interaction ends, either over the target or when the pointer leaves the target. |
| `onPressChange` | `function` |  | Handler that is called when the press state changes. |
| `onPressUp` | `function` |  | Handler that is called when a press is released over the target, regardless of whether it started on the target or not. |
| `onClick` | `function` |  | **Not recommended – use `onPress` instead.** `onClick` is an alias for `onPress` provided for compatibility with other libraries. `onPress` provides additional event details for non-mouse interactions. |
| `autoFocus` | `boolean` |  | Whether the element should receive focus on render. |
| `style` | `StyleOrFunction<ButtonRenderProps>` |  | The inline style for the element. A function may be provided to compute the style based on component state. |
| `children` | `ChildrenOrFunction<ButtonRenderProps>` |  | The children of the component. A function may be provided to alter the children based on component state. |
| `render` | `DOMRenderFunction` |  | Overrides the default DOM element with a custom render function. This allows rendering existing components with built-in styles and behaviors such as router links, animation libraries, and pre-styled components. Requirements: - You must render the expected element type (e.g. if `<button>` is expected, you cannot render an `<a>`). - Only a single root DOM element can be rendered (no fragments). - You must pass through props and ref to the underlying DOM element, merging with your own prop as appropriate. |
| `aria-disabled` | `"false" \| "true" \| boolean` |  | Indicates whether the element is disabled to users of assistive technology. |
| `aria-expanded` | `"false" \| "true" \| boolean` |  | Indicates whether the element, or another grouping element it controls, is currently expanded or collapsed. |
| `aria-haspopup` | `union` |  | Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by an element. |
| `aria-controls` | `string` |  | Identifies the element (or elements) whose contents or presence are controlled by the current element. |
| `aria-pressed` | `"false" \| "mixed" \| "true" \| boolean` |  | Indicates the current "pressed" state of toggle buttons. |
| `aria-current` | `union` |  | Indicates whether this element represents the current item within a container or set of related elements. |
| `type` | `"button" \| "reset" \| "submit"` | 'button' | The behavior of the button when used in an HTML form. |
| `preventFocusOnPress` | `boolean` |  | Whether to prevent focus from moving to the button when pressing it. Caution, this can make the button inaccessible and should only be used when alternative keyboard interaction is provided, such as ComboBox's MenuTrigger or a NumberField's increment/decrement control. |
| `form` | `string` |  | The `<form>` element to associate the button with. The value of this attribute must be the id of a `<form>` in the same document. See MDN. |
| `formAction` | `string \| function` |  | The URL that processes the information submitted by the button. Overrides the action attribute of the button's form owner. |
| `formEncType` | `string` |  | Indicates how to encode the form data that is submitted. |
| `formMethod` | `string` |  | Indicates the HTTP method used to submit the form. |
| `formNoValidate` | `boolean` |  | Indicates that the form is not to be validated when it is submitted. |
| `formTarget` | `string` |  | Overrides the target attribute of the button's form owner. |
| `name` | `string` |  | Submitted as a pair with the button's value as part of the form data. |
| `value` | `string` |  | The value associated with the button's name when it's submitted with the form data. |
| `isPending` | `boolean` |  | Whether the button is in a pending state. This disables press and hover events while retaining focusability, and announces the pending state to screen readers. |
| `disabled` | `boolean` |  | Turns off the control: no focus, no edits, and the disabled look. |
| `className` | `string` |  |  |

### TagGroupDescription

No props of its own: `className`, `children`, and every other prop go to the element it renders.

### TagGroupError

No props of its own: `className`, `children`, and every other prop go to the element it renders.

## Styling

| Part | Slot | States | CSS variables | Tokens |
| --- | --- | --- | --- | --- |
| TagGroup | `tag-group` |  |  |  |
| TagGroupLabel | `tag-group-label` |  |  |  |
| TagGroupList | `tag-group-list` | `data-empty`, `data-focus-visible` |  |  |
| TagGroupTag | `tag-group-tag` | `data-disabled`, `data-focus-visible`, `data-hovered`, `data-href`, `data-pressed`, `data-selected`, `data-selection-mode`, `data-settled`, `data-size` |  | `motion-timing` |
| TagGroupTagRemove | `tag-group-tag-remove` | `data-pressed`, `data-selected` |  |  |
| TagGroupDescription | `tag-group-description` |  |  |  |
| TagGroupError | `tag-group-error` |  |  |  |

## Usage

Set `selectionMode` to pick tags, or pass `onRemove` to remove them. A tag with `href` is a link.

```tsx title="status-filter.tsx"
import { TagGroup, TagGroupLabel, TagGroupList, TagGroupTag } from "@/components/ui/tag-group";

export function StatusFilter() {
  return (
    <TagGroup selectionMode="multiple" defaultValue={["open"]}>
      <TagGroupLabel>Status</TagGroupLabel>
      <TagGroupList>
        <TagGroupTag id="open">Open</TagGroupTag>
        <TagGroupTag id="in-review">In review</TagGroupTag>
        <TagGroupTag id="closed">Closed</TagGroupTag>
      </TagGroupList>
    </TagGroup>
  );
}
```

## Compose

Rules:

- Compose the parts (`compose-parts`): Build each item from its named parts as children, and pass your text and icons in as parts.
- Every state is designed (`every-state`): Give each view of data its loading, empty, and error states: a skeleton in the final layout, an `Empty` with an illustration and one next action, and an error that says what failed and how to retry.

## Add it

```bash
npx shadcn@latest add @gelatin-ui/tag-group
```

It adds 20 registry items: 17 files, 2889 lines, and the npm packages `@base-ui/react`, `@mantine/hooks`, `@phosphor-icons/react`, `clsx`, `motion`, `react-aria-components`, `tailwind-merge`, `tailwind-variants`.

## For AI agents

- Every item, one file: https://gelatinui.com/llms.txt
- MCP server (`search_items`, `get_item`, `get_install_plan`): https://gelatinui.com/mcp

## Related

- [Tags Input](https://gelatinui.com/components/tags-input.md): Pick Tags Input when people type new values that turn into tags.
- [Badge](https://gelatinui.com/components/badge.md): Pick Badge for one status label, count, or plan name with no action.
- [Segmented Control](https://gelatinui.com/components/segmented-control.md)

## Keyboard

| Keys | Action |
| --- | --- |
| Tab | Moves focus to the group. The group is one tab stop. |
| Left Arrow, Right Arrow | Moves focus between the tags. Right to left swaps them. |
| Home, End | Moves focus to the first or the last tag. |
| Enter, Space | In a selectable group, turns the focused tag on or off. |
| Enter | On a link tag, opens the link. |
| Delete, Backspace | With `onRemove`, removes the focused tag. A held key removes one tag. |

## Accessibility

It is a React Aria tag group, a grid with one tab stop. The arrow keys move between tags.

`TagGroupLabel` names the grid. A selected tag shows a check, so color is not the only signal.

On a touch screen the tags are 32px high with 8px between them.

## Motion

| Part | Motion |
| --- | --- |
| New tag | fade · 150ms · ease-out (0, 0, 0.2, 1) · a removed tag goes at once |
