Lynx

Tag Group

An information summary component that displays multiple attributes, states, and metadata at a glance by arranging text tags horizontally.

Engine ≥ 3.6
Available since@seed-design/lynx-react@0.1.0, @seed-design/lynx-css@0.1.0
Loading Lynx example…

Installation

npx @seed-design/cli add ui:tag-group

Props

TagGroupRoot

Prop

Type

style?CSSProperties | undefined
children?React.ReactNode
className?string | undefined

TagGroupItem

Prop

Type

labelReact.ReactNode
flexShrink?boolean | Property.FlexShrink | undefined
className?string | undefined
style?CSSProperties | undefined

Examples

Usage

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.

Sizes

Loading Lynx example…

Weights

Loading Lynx example…

Tones

Loading Lynx example…

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.

Loading Lynx example…

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.

Loading Lynx example…

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.

Loading Lynx example…

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

SlotWebLynx
Root<span> (inline)<view> (flex-row, flex-wrap, width 100%)
Separator<span><text>
Item<span> (inline)<view> (flex-row, flex-shrink 0)
Item Label<span><text>

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

propWeb behaviorReason for Lynx unsupported
truncate (Root)Keep one line + truncate all item labelsIn 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 renderPrimitive Slot pattern not provided in Lynx
prefixIcon / suffixIcon (Item)Icon + labelNo 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 <view>. Internally, LynxViewRef is used, and this type is an alias for React.Ref<NodesRef>.

Table of contents