# Upstage Design System — Button (product)
- context: product
- source revision: lift-1.2.3 (Lift 1.2.3, zip sha256 8d5d9377c2b4…)
- content: draft · availability: implemented · verification: static-only (2026-09-23, target lift-1.0.1)
- human docs: /en/components/product/button/ · machine doc: /agent/components/product/button.md
## Required references (read these)
- /components/actions/Button.jsx — implementation · sha256 eb415a532465…
- /components/_types.d.ts — api · key ButtonProps · sha256 3008e22ddb76…
- /tokens/tokens.product.css — tokens · sha256 b179a0dd277f…
- /kit/context/DESIGN.product.md — rules · B-5 · sha256 b7bc4b85ecf9…
- /kit/rules/a11y-contract.json — a11y · key Button · sha256 55f9ac141668…
- /kit/rules/forbidden-rules.json — rules · sha256 6172deb95cd7…
- /kit/tokens/token-intents.json — intent · key action.primary · sha256 61c49fbf5458…
## Reference examples
- /components/actions/Button.prompt.md — usage-note
## API (from components/_types.d.ts ButtonProps / Button.jsx)
- 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
- sizes: sm 32px, md 40px, lg 48px
- variants: primary, secondary, destructive, outline, ghost, accent
## Rules that apply
- B-5 (DESIGN.product.md §8): one primary action per view; secondary actions are outline/ghost. The secondary variant is a deprecated outline alias.
- M-3 (forbidden-rules.json): use Marketing button tokens for Marketing CTAs, not Product secondary compatibility tokens.
- ALL-1 (forbidden-rules.json): --ups-purple is never an interactive button background.
- a11y-contract.json Button: keys Enter, Space; aria aria-disabled; type="button" 기본
## Unverified
- @upstageai/ui package mapping is not verified in this repository.
- hover/active/focus/disabled behaviour: static source check only.
Supported environment
The Lift 1.2.3 reference implementation is a React 18 function component. Styles are inline and every colour references a Product semantic token (hsl(var(--*))), so styles.product.css (or primitives.css + tokens.product.css) must be loaded. The prop contract is ButtonProps in components/_types.d.ts. The mapping to the npm package (@upstageai/ui) could not be verified in this repository.
Install and wire up
- Copy references/starter-kit/components/actions/Button.jsx and components/_types.d.ts from the Lift skill into the project and import them by relative path.
- In HTML demos _ds_bundle.js exposes the component on window.UpstageDesignSystem_bdeb42. This site's preview and the Console kit render the real source the same way.
- For Tailwind 3 + @upstageai/ui 1.2.x or Tailwind 4 + 2.1.0+, follow the Lift skill's scripts/detect_compat.py and references/compatibility.md. This site did not verify that path.
API
The prop table is read from ButtonProps in components/_types.d.ts and the value lists and sizes from Button.jsx at build time. ButtonProps accepts every native button attribute, including onClick. loading and asChild are not part of this implementation.
| prop | type | default | doc |
|---|---|---|---|
variant | "primary" | "secondary" | "destructive" | "outline" | "ghost" | "accent" | primary | Visual variant. Prefer outline/ghost for secondary actions; secondary is a deprecated outline alias. |
size | "sm" | "md" | "lg" | md | Control height: sm 32 / md 40 / lg 48 |
disabled | boolean | false | |
children | React.ReactNode | — | |
style | React.CSSProperties | — |
Any other prop passes through as ...rest to the button element. Attributes the implementation always sets: aria-disabled, data-ds-focus, disabled, type.
Code
import { Button } from "./components/actions/Button.jsx";
<Button variant="primary" size="md" onClick={createKey}>Create API key</Button>
<Button variant="outline">Cancel</Button>The interactive preview is on the Overview tab, same source and runtime. Overview
Token bindings
--accent, --accent-active, --accent-border, --accent-foreground, --accent-hover, --border, --btn-ghost-active, --btn-ghost-hover, --btn-outline-active, --btn-outline-border-hover, --btn-outline-hover, --destructive, --destructive-active, --destructive-foreground, --destructive-hover, --disabled, --disabled-border, --disabled-foreground, --font-sans, --foreground, --primary, --primary-active, --primary-foreground, --primary-hover, --transition-colors
| variant | Use | Base background | tokens |
|---|---|---|---|
primary | The view’s main action. One per view | hsl(var(--primary)) | --primary, --primary-active, --primary-foreground, --primary-hover |
secondary | Compatibility alias for outline. Use outline or ghost for new secondary actions. | transparent | --border, --btn-outline-active, --btn-outline-border-hover, --btn-outline-hover, --foreground |
destructive | Delete and other irreversible actions | hsl(var(--destructive)) | --destructive, --destructive-active, --destructive-foreground, --destructive-hover |
outline | Secondary action, e.g. Cancel beside a primary | transparent | --border, --btn-outline-active, --btn-outline-border-hover, --btn-outline-hover, --foreground |
ghost | Lowest emphasis, e.g. toolbar or table actions | transparent | --btn-ghost-active, --btn-ghost-hover, --foreground |
accent | brand-50 tint for selected or active-state actions | hsl(var(--accent)) | --accent, --accent-active, --accent-border, --accent-foreground, --accent-hover |
size
| size | min-height | padding | font-size | radius |
|---|---|---|---|---|
sm | 32px | 0 12px | 13px | 6px |
md | 40px | 0 16px | 14px | 8px |
lg | 48px | 0 20px | 16px | 8px |
Values parsed at build time from components/actions/Button.jsx (Lift 1.2.3). disabled uses --disabled, --disabled-border, --disabled-foreground.
Constraints
- type="button" is the default. Pass type="submit" explicitly for form submission.
- disabled sets both DOM disabled and aria-disabled.
- hover and active are internal component state, not CSS :hover. Handlers passed from outside, such as onMouseEnter or onKeyDown, are still called after the internal handling (Lift 1.0.1).
- aria-*, data-* and onClick pass through as rest props.
Source
components/actions/Button.jsximplementation · lift-1.2.3 1.2.3 ·eb415a532465components/_types.d.tsapi · ButtonProps · lift-1.2.3 1.2.3 ·3008e22ddb76components/actions/Button.prompt.mdusage-note · lift-1.2.3 1.2.3 ·8f351773e8fftokens/tokens.product.csstokens · lift-1.2.3 1.2.3 ·b179a0dd277fkit/context/DESIGN.product.mdrules · B-5 · lift-1.2.3 1.2.3 ·b7bc4b85ecf9kit/rules/a11y-contract.jsona11y · Button · lift-1.2.3 1.2.3 ·55f9ac141668kit/rules/forbidden-rules.jsonrules · lift-1.2.3 1.2.3 ·6172deb95cd7kit/tokens/token-intents.jsonintent · action.primary · lift-1.2.3 1.2.3 ·61c49fbf5458
File sha256 values are computed at build time and match /agent-manifest.json.