# Button — product (machine doc)

id: product.button · context: product · content: draft · availability: implemented · verification: static-only (2026-09-23, target lift-1.0.1)
source revision: lift-1.2.3 = Lift 1.2.3 · zip sha256 8d5d9377c2b4fc4807153376f22ad588e6d0e82e13415b09fe08da0cb6564cda
human docs: /ko/components/product/button/ · /ko/components/product/button/usage/ · /ko/components/product/button/implementation/ · /ko/components/product/button/accessibility/ (EN under /en/)
updated: 2026-09-23 · reviewer: unassigned

## Summary

Product 화면의 주요·보조·파괴적 동작 버튼. 한 화면에 primary 는 하나(B-5).

사용자가 지금 할 수 있는 동작을 드러내고, 그중 무엇이 주요 동작인지 한눈에 구별하게 한다. Button 은 클릭·키보드로 실행되는 동작에만 쓴다. 다른 페이지로 이동하는 링크에는 쓰지 않는다.

## API (parsed from components/_types.d.ts ButtonProps / Button.jsx at build time)

- `variant`: `"primary" | "secondary" | "destructive" | "outline" | "ghost" | "accent"` — Visual variant. Prefer outline/ghost for secondary actions; secondary is a deprecated outline alias. · default `primary`
- `size`: `"sm" | "md" | "lg"` — Control height: sm 32 / md 40 / lg 48 · default `md`
- `disabled`: `boolean` · default `false`
- `children`: `React.ReactNode`
- `style`: `React.CSSProperties`

### variants

- `primary` — 화면의 주요 동작. 한 화면에 하나 · base `hsl(var(--primary))` · tokens `--primary`, `--primary-active`, `--primary-foreground`, `--primary-hover`
- `secondary` — outline과 같은 호환 별칭입니다. 새 보조 동작에는 outline 또는 ghost를 사용합니다. · base `transparent` · tokens `--border`, `--btn-outline-active`, `--btn-outline-border-hover`, `--btn-outline-hover`, `--foreground`
- `destructive` — 삭제·되돌릴 수 없는 동작 · base `hsl(var(--destructive))` · tokens `--destructive`, `--destructive-active`, `--destructive-foreground`, `--destructive-hover`
- `outline` — 보조 동작. primary 옆의 취소·닫기 · base `transparent` · tokens `--border`, `--btn-outline-active`, `--btn-outline-border-hover`, `--btn-outline-hover`, `--foreground`
- `ghost` — 가장 낮은 강조. 툴바·표 안의 동작 · base `transparent` · tokens `--btn-ghost-active`, `--btn-ghost-hover`, `--foreground`
- `accent` — brand-50 틴트. 선택·활성 상태를 띤 동작 · base `hsl(var(--accent))` · tokens `--accent`, `--accent-active`, `--accent-border`, `--accent-foreground`, `--accent-hover`

### sizes

- `sm` — min-height 32px · padding `0 12px` · font 13px · radius 6px
- `md` — min-height 40px · padding `0 16px` · font 14px · radius 8px
- `lg` — min-height 48px · padding `0 20px` · font 16px · radius 8px
- disabled tokens: `--disabled`, `--disabled-border`, `--disabled-foreground`
- always-set attributes: `aria-disabled`, `data-ds-focus`, `disabled`, `type`

## Usage (required rules)

- use: 폼 제출, 생성, 저장처럼 현재 화면에서 완료되는 동작
- use: 삭제·해지처럼 결과가 있는 동작 (destructive)
- use: 대화상자·툴바·표 행의 보조 동작 (outline · ghost)
- do not use: 다른 페이지로 이동 → 링크
- do not use: 즉시 적용되는 on/off → Switch
- do not use: 아이콘만 놓을 자리 → IconButton
- do not use: Website·Marketing 면의 CTA → 각 맥락의 CTA (.button 콤보 / --marketing-btn-*)
- placement: 한 작업 영역에서 primary 는 하나. 보조 동작은 outline·ghost 로 강조를 낮춘다(B-5).
- placement: 대화상자에서는 primary 를 오른쪽 끝, 취소를 그 왼쪽에 둔다.
- placement: destructive 는 확인 단계와 함께 쓴다. 되돌릴 수 없는 동작을 한 번의 클릭으로 끝내지 않는다.
- B-5: do primary 하나 + outline 취소 / don't primary 두 개를 나란히 — 한 면에 시각적으로 동등한 복수 CTA 를 두면 주요 동작을 구별할 수 없다.
- M-3: do Product 보조 동작은 outline·ghost로 / don't Product의 secondary 호환 토큰을 Marketing CTA로 — Marketing CTA는 Marketing의 버튼 토큰을 사용합니다. Product 호환 토큰을 다른 맥락에 가져오지 않습니다.
- ALL-1: do primary 배경은 hsl(var(--primary)) / don't --ups-purple 을 버튼 배경으로 — --ups-purple 은 장식용이다. 인터랙티브 버튼 배경으로 쓰지 않는다.

## Implementation constraints

- type="button" 이 기본이다. 폼 제출에는 type="submit" 을 명시해 넘긴다.
- disabled 는 DOM disabled 와 aria-disabled 를 함께 설정한다.
- hover·active 는 컴포넌트 내부 state 로 처리되며 CSS :hover 가 아니다. 외부에서 넘긴 onMouseEnter·onKeyDown 등은 내부 처리 뒤 그대로 호출된다(Lift 1.0.1).
- rest prop 으로 aria-*, data-*, onClick 이 그대로 전달된다.

## Accessibility

- contract (a11y-contract.json v0.5.0 · Button): keys Enter, Space · aria aria-disabled · type="button" 기본
- 역할은 네이티브 button 이다. 이름은 라벨 텍스트에서 온다. 아이콘만 있으면 IconButton 과 aria-label 을 쓴다. disabled 는 DOM disabled + aria-disabled 로 전달된다.
- Tab 으로 도달, Enter·Space 로 실행(a11y-contract.json Button.keys). 구현은 Enter·Space keydown 에서 active 상태를 보여준다.
- data-ds-focus 가 달려 있어 tokens/a11y.css 의 공통 포커스 링(3px, --focus-ring-color, offset 2px)이 :focus-visible 에서 나타난다. 컴포넌트가 자체 링을 그리지 않는다.
- 실행 결과는 버튼 색만으로 전하지 않는다. 성공·실패는 Toast·Banner 등 DOM 텍스트로 알린다. 구현에 loading 상태는 없으므로 진행 중 표시가 필요하면 별도 텍스트로 처리한다.
- product.css 주석에 기록된 대비: primary hover 6.51:1, active 8.04:1, destructive hover 6.16:1, active 7.99:1, accent hover 8.27:1, active 6.72:1. 기본 상태와 disabled 조합은 이 사이트에서 측정하지 않았다.

## Source references (path · role · sha256)

- /components/actions/Button.jsx · implementation · lift-1.2.3 1.2.3 · eb415a5324657f44980941ebc056cd58307741777cb34364dc7a3893bc63486e
- /components/_types.d.ts · api · ButtonProps · lift-1.2.3 1.2.3 · 3008e22ddb767b78594a3cfec4b9537d52a71fa96950cdfa3cd0600740f771f2
- /components/actions/Button.prompt.md · usage-note · lift-1.2.3 1.2.3 · 8f351773e8ffe3f9fb8259fb438c54de9f7da29d2e9512a7790dfd22fe902365
- /tokens/tokens.product.css · tokens · lift-1.2.3 1.2.3 · b179a0dd277f0e4f6899d5fceddad2f8138ad84243c42e1d2c1150619379c482
- /kit/context/DESIGN.product.md · rules · B-5 · lift-1.2.3 1.2.3 · b7bc4b85ecf95e1901596abc0ea58b42062a1825877b83adc4593a90f9bee041
- /kit/rules/a11y-contract.json · a11y · Button · lift-1.2.3 1.2.3 · 55f9ac141668b957bcdc13e2f3b8cbc8b387da8ac115d33430c3d4f966fcca21
- /kit/rules/forbidden-rules.json · rules · lift-1.2.3 1.2.3 · 6172deb95cd78a7995bc5180f570e29ece43b6c5406b188a9323e1dc769580d0
- /kit/tokens/token-intents.json · intent · action.primary · lift-1.2.3 1.2.3 · 61c49fbf5458bcc59c7845e3a934e31d921705b292089f8345d6d65cf525611a

## Unverified

- @upstageai/ui 패키지와의 API 대응은 이 저장소에서 확인하지 못했다.
- hover/active/focus/disabled 동작은 정적 소스 확인만 했다.
- 검증 상태: static-only. 스크린 리더·키보드 동작의 브라우저 검증은 미실시.
