# Tag Group
URL: /lynx/components/tag-group
Source: https://github.com/daangn/seed-design/blob/dev/docs/content/lynx/components/tag-group.mdx
An information summary component that displays multiple attributes, states, and metadata at a glance by arranging text tags horizontally.
Lynx Engine 최소 버전: 3.6
사용 가능 버전: @seed-design/lynx-react@0.1.0, @seed-design/lynx-css@0.1.0
## Preview
```tsx
import "./styles";
import { useSeedClassName } from "@seed-design/lynx-react";
import { TagGroupRoot, TagGroupItem } from "@/components/ui/tag-group";
export default function Example() {
const seedClassName = useSeedClassName({ colorMode: "system" });
return (
);
}
```
## Installation
- npm: npx @seed-design/cli add ui:tag-group
- pnpm: pnpm dlx @seed-design/cli add ui:tag-group
- yarn: yarn dlx @seed-design/cli add ui:tag-group
- bun: bun x @seed-design/cli add ui:tag-group
## Props
### `TagGroupRoot`
### `TagGroupItem`
## Examples
### Usage
The installed snippet exports `TagGroupRoot` and `TagGroupItem`. `TagGroupItem` receives the `label` prop and renders a Lynx `` label internally.
```tsx
import { TagGroupRoot, TagGroupItem } from "@/components/ui/tag-group";
export function App() {
return (
);
}
```
The `size`, `weight`, and `tone` of `TagGroupRoot` are propagated to child `TagGroupItem` through Context and can be overridden with props in individual `TagGroupItem`. The default separator is `"·"` and can be changed with the `separator` prop.
`TagGroupItem` supports `flexShrink`. Use it when you need to adjust the shrink priority of an item in a layout with long tags.
`TagGroup` is a component that displays information in read-only format. It does not provide APIs for single/multi-select, changing selected values, or disabled states. If users need to select values, use `RadioGroup` for single selection and `Checkbox` for multi-select.
### Sizes
```tsx
import "./styles";
import { VStack, useSeedClassName } from "@seed-design/lynx-react";
import { TagGroupRoot, TagGroupItem } from "@/components/ui/tag-group";
export default function Example() {
const seedClassName = useSeedClassName({ colorMode: "system" });
return (
);
}
```
### Weights
```tsx
import "./styles";
import { VStack, useSeedClassName } from "@seed-design/lynx-react";
import { TagGroupRoot, TagGroupItem } from "@/components/ui/tag-group";
export default function Example() {
const seedClassName = useSeedClassName({ colorMode: "system" });
return (
);
}
```
### Tones
```tsx
import "./styles";
import { VStack, useSeedClassName } from "@seed-design/lynx-react";
import { TagGroupRoot, TagGroupItem } from "@/components/ui/tag-group";
export default function Example() {
const seedClassName = useSeedClassName({ colorMode: "system" });
return (
);
}
```
### With Icons
Lynx Registry's `TagGroupItem` does not provide `prefixIcon` and `suffixIcon`. Compose information that requires icons in a separate layout in your app.
### Customizing `TagGroupItem`
The `tone` and `weight` of `TagGroupRoot` are passed as group defaults. You can override only the values you need in individual `TagGroupItem`.
Use the compound components from `@seed-design/lynx-react` only when you need to compose internal elements directly.
Icons in the React example are omitted because they have no corresponding props in the Lynx Registry. Text, item count, and individual tone and weight settings remain the same.
```tsx
import "./styles";
import { TagGroup as SeedTagGroup, VStack, useSeedClassName } from "@seed-design/lynx-react";
import { TagGroupRoot, TagGroupItem } from "@/components/ui/tag-group";
export default function Example() {
const seedClassName = useSeedClassName({ colorMode: "system" });
return (
4.5
);
}
```
### Customizing Separators
You can change the separator with `separator` of `TagGroupRoot`. Express meaningful information with `TagGroupItem` instead of a separator.
Whitespace before and after string separators is removed in Lynx. For example, `separator=" / "` and `separator="/"` are rendered identically, and the spacing between items and separators is consistently applied by the component.
Therefore, a single space separator in the web example becomes an empty string in Lynx. In this example, `/` is used as the second separator.
```tsx
import "./styles";
import { VStack, useSeedClassName } from "@seed-design/lynx-react";
import { TagGroupRoot, TagGroupItem } from "@/components/ui/tag-group";
export default function Example() {
const seedClassName = useSeedClassName({ colorMode: "system" });
return (
);
}
```
### Wrapping Behavior
When the container width is exceeded, the separator and following item are placed on the next line as a single unit.
The default line break example uses the same text and container width as React but omits icons. Lynx also does not support `truncate`. If you need icons or single-line truncation, compose them as a separate layout in your app.
```tsx
import "./styles";
import { Text, VStack, useSeedClassName } from "@seed-design/lynx-react";
import { TagGroupRoot, TagGroupItem } from "@/components/ui/tag-group";
export default function Example() {
const seedClassName = useSeedClassName({ colorMode: "system" });
return (
default (wrap)
);
}
```
## Web Version Differences
Lynx TagGroup has the following differences from the React web version due to constraints of the Lynx view engine (Yoga-based flex).
### Rendering Elements
| Slot | Web | Lynx |
| ---------- | ----------------- | ------------------------------------------ |
| Root | `` (inline) | `` (flex-row, flex-wrap, width 100%) |
| Separator | `` | `` |
| Item | `` (inline) | `` (flex-row, flex-shrink 0) |
| Item Label | `` | `` |
### Layout Model Differences
- **Web**: Text flow based on `display: inline`. If the container is narrow, the last item's internal label text naturally wraps at the word level (e.g., `"Ut minim laboris enim"` → split into `"Ut minim"` / `"laboris enim"` on two lines).
- **Lynx**: Item-level wrap based on flex. Items maintain content-size, and if they don't fit on one line, the entire item moves to the next line. The behavior of text inside an item being word-broken beyond item boundaries cannot be replicated. Lynx `TagGroupRoot` makes this look natural by grouping the separator and following item as a single wrap unit, moving them together to the next line.
### Separator Whitespace Handling
Web preserves whitespace before and after string separators with `white-space: pre`. Lynx does not support `white-space: pre`, and the default whitespace measurement also differs between browser preview and native Lynx. To create the same spacing in both runtime environments, Lynx `TagGroup` removes whitespace before and after string separators and applies component style spacing. Non-string `ReactNode` separators are not changed.
### Unsupported Props
| prop | Web behavior | Reason for Lynx unsupported |
| ---------------------------------- | ---------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `truncate` (Root) | Keep one line + truncate all item labels | In the Lynx flex model, labels don't fit the item width, so web-level inline ellipsis doesn't work. Applying truncation to all items consistently doesn't feel natural, so it was removed |
| `asChild` (Root/Item) | Slot-based polymorphic render | Primitive Slot pattern not provided in Lynx |
| `prefixIcon` / `suffixIcon` (Item) | Icon + label | No icon props and slots in current Lynx Registry and Recipe |
### Events/Ref
- Events: Lynx uses `bindtap` / `main-thread:bindtap` instead of `onClick`. `TagGroup` is a static display component, so it doesn't expose interaction props for managing selected values or disabled states.
- ref: Refs for Root and Item are passed as ``. Internally, `LynxViewRef` is used, and this type is an alias for `React.Ref`.