Tag
A compact token with optional icon and removal action.
Use Tag for compact tokens such as selected filters, categories, or people. Add an icon or a removal action when needed. For a read-only label, use Badge; for an operational state, use Status Pill. Use Tag Input to manage tags inside an input field.
Import
Section titled “Import”import { Tag } from "@zentara-co/zenos-ui";Appearance
Section titled “Appearance”The default appearance is a compact, 20px-high tag with slightly rounded corners. Set appearance="rounded" for a 24px-high pill. Appearance and color are independent.
Colors
Section titled “Colors”Tags use the neutral palette by default. Choose an accent with color, or its lighter counterpart with the -light suffix. The ten accent hues are blue, red, yellow, green, teal, purple, gray, lime, orange, and magenta. These palettes use semantic background and text tokens for both themes.
Removable tags
Section titled “Removable tags”Pass onRemove to Tag to add a remove button. The parent owns the selected values and removes the tag from its list; Tag does not remove itself. Plain-text children are included in the button’s accessible name automatically.
3 filters selected.
Accessible removal labels
Section titled “Accessible removal labels”For rich content, supply label so the default button name identifies the tag. This prop describes the remove action; it does not render visible text. Use removeLabel to override the complete button name when more context is helpful.
Design team filter selected.
Compound composition
Section titled “Compound composition”Use Tag.Root, Tag.Icon, Tag.Label, and Tag.Remove for explicit composition. Unlike Tag, Tag.Root does not add a label wrapper or remove button automatically: include those parts yourself and pass onRemove to the root.
Tag.Icon is decorative and hidden from assistive technology. Tag.Label truncates when its container has a constrained width. Setting disabled on the root dims the tag and disables its remove button.
Custom styling
Section titled “Custom styling”Use the usual className prop for your own styling. You do not need to pass appearance, color, or variant to customize a tag. Conflicting utility classes override the built-in appearance and palette. Each compound part also accepts className, native props, and a ref.
Tag Tag.Root Tag.Icon Tag.Label Tag.Remove
API
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | — | Visible content. Tag wraps it in Tag.Label and adds Tag.Remove when onRemove is supplied; Tag.Root renders compound parts directly. |
label | string | — | Text used to name the remove button, not a rendered label. Tag infers it from plain-text children; set it for rich content or Tag.Root. |
className | string | — | Custom styling and instance overrides. Appearance and color props are optional. |
appearance | default | rounded | default | Compact, slightly rounded corners or a taller pill shape. |
color | neutral | blue | blue-light | red | red-light | yellow | yellow-light | green | green-light | teal | teal-light | purple | purple-light | gray | gray-light | lime | lime-light | orange | orange-light | magenta | magenta-light | neutral | Accent or neutral fill matching the design system Tag palette. |
variant | default | neutral | outline | — | Deprecated. Prefer `color` and `appearance`. `outline` keeps a bordered tag. |
onRemove | () => void | — | Called on removal. Tag automatically adds a remove button; Tag.Root requires an explicit Tag.Remove. The parent owns the item list. |
removeLabel | string | — | Overrides the remove button's accessible name. |
disabled | boolean | false | Dims the tag, exposes aria-disabled, and disables its remove button. |
Tag.Remove.label / aria-label | string | — | Overrides the individual remove button's accessible name. aria-label takes precedence over label, then the root removeLabel. |
native props | React.HTMLAttributes<HTMLSpanElement> | — | Forwards native attributes, events, aria-*, data-*, className, style, and ref. |
Unless narrowed above, each DOM-rendering part also accepts its underlying native or Base UI props,
including className, style, aria-*, and data-*.
Accessibility
Section titled “Accessibility”Static tags render as non-interactive spans. A removable tag contains a native button whose default name is “Remove” followed by the tag label; it supports normal keyboard activation. Tag.Remove also accepts a local label or aria-label to override that name.
Disabled tags expose aria-disabled, and their remove buttons are natively disabled. Do not make the entire tag clickable when only removal is intended. When removing an item, manage focus in the owning list or field so keyboard users can continue from a meaningful position.