React

Tag Group

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

Available since@seed-design/react@1.0.6, @seed-design/css@1.0.6

Installation

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

Props

TagGroupRoot

Prop

Type

separator?React.ReactNode

TagGroupItem

Prop

Type

prefixIcon?React.ReactNode
labelReact.ReactNode
suffixIcon?React.ReactNode

Examples

Sizes

Weights

Tones

With Icons

Customizing TagGroupItem

The size, tone, and weight specified on TagGroupRoot can be overridden on TagGroupItem.

If needed, you can customize the internal elements of TagGroupItem by directly using compound components.

Customizing Separators

You can change the separator by specifying separator on TagGroupRoot.

Screen readers do not read the specified separator between each tag item. Avoid using semantic information as a separator.

Wrapping Behavior

By default, TagGroupRoot wraps when it exceeds the container width.

When you specify the truncate prop on TagGroupRoot, TagGroupRoot is maintained on one line, and if it exceeds the container width, ellipsis may occur on all TagGroupItem labels by default.

To prevent a specific item from shrinking while using the truncate prop, specify flexShrink={0} on that TagGroupItem. You can adjust the priority of shrinking when exceeding container width by specifying flexShrink={number} on TagGroupItem.

Table of contents