Skip to content
GitHub (opens in a new tab)

Tag

Label the user applies or manages: removable, selectable, with optional count, status dot, or avatar.

stableAtomcontracts/tag.json

Preview

Tags

Labels the user applies or manages. Removable, selectable, with an optional count, dot, or avatar.

Master

A removable Tag at md. Remove it, then Reset to bring it back. Variants shows sizes, selectable, count, dot and avatar.

Design

Usage

Tag for labels the user adds, removes, or picks. Only the checkbox and the X are interactive; the Tag itself is not a button.

Do's

  • Which mark: Tag is a label the user adds, picks or removes (hairline border with X or checkbox, 2px corner like Badge).
  • Filter chips the user picks or clears
  • Keywords, topics, or labels the user adds to a record
  • Assigned people or teams shown as removable labels
  • Removable chips inside another control, like picked values in a Select

Don'ts

  • Read-only status or category set by the system (Paid, Overdue, Beta) — use Badge
  • Money or metric changes — use Delta
  • Overflow +N counts — use Count (MultiSelect shows its +N as kit Count)
  • Primary or secondary actions — use Button
  • A person on their own — use Avatar
  • Single-choice segmented options — use ButtonGroup or Tabs

Badge or Tag?

Badge is read-only status or category the system sets, like Paid, Overdue, or Beta. Tag is a label the user applies or manages: filter chips, keywords, assigned people. If the user can remove or select it, use Tag.

<Tag
  size="md"
  removable
  onRemove={() => {}}
>
  Design
</Tag>

When to use

  • Which mark: Tag is a label the user adds, picks or removes (hairline border with X or checkbox, 2px corner like Badge).
  • Filter chips the user picks or clears
  • Keywords, topics, or labels the user adds to a record
  • Assigned people or teams shown as removable labels
  • Removable chips inside another control, like picked values in a Select

When not to use

  • Read-only status or category set by the system (Paid, Overdue, Beta) — use Badge
  • Money or metric changes — use Delta
  • Overflow +N counts — use Count (MultiSelect shows its +N as kit Count)
  • Primary or secondary actions — use Button
  • A person on their own — use Avatar
  • Single-choice segmented options — use ButtonGroup or Tabs

What an agent reads

import { Tag } from "agentic-ds-kit";
must
  • Plain Tag is a span with readable text
  • Selectable: the kit Checkbox is the control; it is labelled by the Tag text and the text is its <label>
  • Removable: the X is a button with aria-label Remove {children}
  • disabled sets aria-disabled and disables both the checkbox and the remove button
  • Dot is aria-hidden; never the only signal
  • Avatar is aria-hidden when its name matches the Tag text, so the name is read once
  • Checkbox and remove button show a focus-visible ring using --border-focus
  • built-in labels (remove) come from KitLabelsProvider; English by default
defaults
  • size md
  • removable false
  • selectable false
  • defaultSelected false
  • disabled false
stops if
  • Do not invent a local Tag, Chip, or FilterChip
  • Do not use Tag for system status — use Badge
  • Do not use raw hex or primitive --color-* ramps
  • Do not make the whole Tag a button; only the checkbox and the remove control are interactive
  • Do not stack more than one leading visual (pick one of checkbox, dot, avatar) unless the design needs it

From contracts/tag.json: must is the a11y requirements, defaults the prop defaults, stops if the doNot rules where the agent asks instead of inventing a cousin.

Props

NameTypeRequiredDefaultNotes
childrenstringYes——
sizesm | md | lgNomdSame sizes as Badge
removablebooleanNofalse—
onRemovefunctionNo—(event) => void; used when removable. The event lets a parent control stop propagation.
selectablebooleanNofalseLeading kit Checkbox, labelled by the Tag text
selectedbooleanNo—controlled; selectable only
defaultSelectedbooleanNofalseuncontrolled; selectable only
onSelectedChangefunctionNo—(selected: boolean) => void
countnumberNo—Trailing kit Count, size sm, intent neutral, subtle
dotenumNo—Leading status dot; decorative, the text carries the meaning neutral | success | warning | danger | info
avatarobjectNo—{ name: string; src?: string } — leading kit Avatar sized to the Tag (20/24/32px via space tokens) with an even space.inset.2xs inset when it leads; sm shows one initial
disabledbooleanNofalse—
idstringNo—Checkbox id when selectable; generated when omitted
  • Component
    →

    Badge

    Compact read-only status or category pill set by the system.

  • Component
    →

    Delta

    How a value moved: an arrow and the signed change in success, danger or neutral text, with no fill.

  • Component
    →

    Count

    Small number badge for counts, like unread items on a nav link or tab.

  • Component
    →

    MultiSelect

    Choose several values.