Components

Badge

Color label chip for categorization and status indication

Overview

Badge is a color label chip. It supports three modes: read-only, removable, and add button.

  • 6 colors — blue, gray, green, purple, red, yellow
  • 3 modes — Default (read-only), removable (onRemove), add button (addButtonVariant)
  • Chevron icon — Displays chevron in default mode when connected to a selector

Basic Usage

Website
Brand
Research
Hiring
Bugs
Other

Colors

ColorExample Usage
blueIn progress, informational
grayDefault, inactive
greenCompleted, success
purpleSpecial, premium
redUrgent, error
yellowWarning, pending

Props

PropTypeDefaultRequiredDescription
addButtonVariant'default' | 'error'-NoRenders the add button. error shows the required-but-empty state
itemBadgeItem | OmittedBadgeItem-YesThe item to show: name and color
isOpenedSelectorboolean-NoRotates the chevron while the attached selector is open
withoutIconboolean-NoHides the chevron
openSelector(e: MouseEvent<HTMLButtonElement>) => void-NoCalled when the add button is pressed
onRemove() => void-NoShows a remove button and is called when it is pressed

BadgeItem Type

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

Specification

base

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

addButtonVariant=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

addButtonVariant=error

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

Guidelines

  • Use Badge for single selection; use Tag for multi-selection
  • Combine with BadgeSelector for a selection UI with built-in CRUD functionality