The installed snippet exports TagGroupRoot and TagGroupItem. TagGroupItem receives the label prop and renders a Lynx <text> label internally.
import { TagGroupRoot, TagGroupItem } from "@/components/ui/tag-group";export function App() { return ( <TagGroupRoot size="t2"> <TagGroupItem label="Neighborhood verification" /> <TagGroupItem label="Manner temperature 42.0°C" /> <TagGroupItem tone="brand" weight="bold" label="Recommended" /> </TagGroupRoot> );}
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.
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.
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.
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.
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.
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.
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: 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 <view>. Internally, LynxViewRef is used, and this type is an alias for React.Ref<NodesRef>.