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 asRemovefollowed by the tag name (for example,Remove Design) - Add button — Add trigger with
+icon viaaddTagButtonVariant
Basic Usage
Differences from Badge
| Feature | Tag | Badge |
|---|---|---|
| Selection mode | Multi-select | Single select |
| Add icon | + icon | Chevron icon |
| Remove callback | removeFromTask(id) | onRemove() |
| Color required | Required in TagType | Optional in BadgeItem |
Props
| Prop | Type | Default | Required | Description |
|---|---|---|---|---|
addTagButtonVariant | 'default' | 'error' | - | No | Renders the add button. error shows the required-but-empty state |
tag | TagType | OmittedTag | - | Yes | The tag to show: name and color |
openTagSelector | (e: MouseEvent<HTMLButtonElement>) => void | - | No | Called when the add button is pressed |
removeFromTask | (id: string) => void | - | No | Shows 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
| 상태 | 요소 | 속성 | 값 |
|---|---|---|---|
| enabled | root | borderRadius | $size.radius.100 |
| enabled | root | typography | $text.singleLine.caption |
| enabled | root | padding | 6px 12px토큰 아님 — space.150 and space.300 |
| enabled | root | backgroundColor | var(--background-tag-<color>)토큰 아님 — set by tag.color (blue, gray, green, purple, red, yellow) |
| enabled | root | color | var(--text-tag-<color>)토큰 아님 — set by tag.color |
| enabled | addButton | borderWidth | $size.stroke.border |
| enabled | addButton | borderStyle | dashed토큰 아님 — no line style token |
| enabled | addButton | borderColor | $color.border.default.secondary |
| enabled | addButton | padding | 5px 11px토큰 아님 — space.150 and space.300 minus the border so the button is as tall as a tag |
| focusVisible | addButton | outlineWidth | $size.stroke.focus |
| focusVisible | addButton | outlineStyle | solid토큰 아님 — no line style token |
| focusVisible | addButton | outlineColor | $color.border.focus.default |
| focusVisible | addButton | outlineOffset | 2px토큰 아님 — no ring offset token |
addTagButtonVariant=default
| 상태 | 요소 | 속성 | 값 |
|---|---|---|---|
| enabled | addButton | backgroundColor | $color.background.default.default |
| enabled | addButton | color | $color.text.default.secondary |
| hover | addButton | backgroundColor | $color.background.default.defaultHover |
| hover | addButton | color | $color.text.default.default |
| hover | addButton | borderColor | $color.border.default.tertiary |
addTagButtonVariant=error
| 상태 | 요소 | 속성 | 값 |
|---|---|---|---|
| enabled | addButton | backgroundColor | $color.background.danger.secondary |
| enabled | addButton | color | $color.text.danger.default |
| enabled | addButton | borderColor | $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