Components

Tag

Color tag chip optimized for multi-select contexts

Overview

Tag is a color tag chip. Similar to Badge but optimized for multi-select contexts.

  • 6 colors — blue, gray, green, purple, red, yellow
  • Removable — Remove by passing tag id via removeFromTask. The remove button is announced as Remove followed by the tag name (for example, Remove Design)
  • Add button — Add trigger with + icon via addTagButtonVariant

Basic Usage

Design
Development
Review
Blocked
Design
Development

Differences from Badge

FeatureTagBadge
Selection modeMulti-selectSingle select
Add icon+ iconChevron icon
Remove callbackremoveFromTask(id)onRemove()
Color requiredRequired in TagTypeOptional in BadgeItem

Props

PropTypeDefaultRequiredDescription
addTagButtonVariant'default' | 'error'-NoRenders the add button. error shows the required-but-empty state
tagTagType | OmittedTag-YesThe tag to show: name and color
openTagSelector(e: MouseEvent<HTMLButtonElement>) => void-NoCalled when the add button is pressed
removeFromTask(id: string) => void-NoShows a remove button and is called with the tag id when it is pressed

TagType

export type TagColor = 'blue' | 'gray' | 'green' | 'purple' | 'red' | 'yellow'
export type TagType = {
  id: string
  name: string
  color: TagColor
  createdAt: Date
  updatedAt: Date
  deletedAt: Date | null
}

Specification

base

상태요소속성값
enabledrootborderRadius$size.radius.100
enabledroottypography$text.singleLine.caption
enabledrootpadding6px 12px토큰 아님 — space.150 and space.300
enabledrootbackgroundColorvar(--background-tag-<color>)토큰 아님 — set by tag.color (blue, gray, green, purple, red, yellow)
enabledrootcolorvar(--text-tag-<color>)토큰 아님 — set by tag.color
enabledaddButtonborderWidth$size.stroke.border
enabledaddButtonborderStyledashed토큰 아님 — no line style token
enabledaddButtonborderColor$color.border.default.secondary
enabledaddButtonpadding5px 11px토큰 아님 — space.150 and space.300 minus the border so the button is as tall as a tag
focusVisibleaddButtonoutlineWidth$size.stroke.focus
focusVisibleaddButtonoutlineStylesolid토큰 아님 — no line style token
focusVisibleaddButtonoutlineColor$color.border.focus.default
focusVisibleaddButtonoutlineOffset2px토큰 아님 — no ring offset token

addTagButtonVariant=default

상태요소속성값
enabledaddButtonbackgroundColor$color.background.default.default
enabledaddButtoncolor$color.text.default.secondary
hoveraddButtonbackgroundColor$color.background.default.defaultHover
hoveraddButtoncolor$color.text.default.default
hoveraddButtonborderColor$color.border.default.tertiary

addTagButtonVariant=error

상태요소속성값
enabledaddButtonbackgroundColor$color.background.danger.secondary
enabledaddButtoncolor$color.text.danger.default
enabledaddButtonborderColor$color.border.danger.default

Guidelines

  • Use Tag + TagSelector for multi-select; use Badge + BadgeSelector for single select
  • Tag can also be used for read-only display without add/remove UI