콘텐츠로 이동

Action Button

텍스트로 결과를 설명하고 행동을 실행하는 버튼입니다.

기본 예제

Svelte 설치 안내

코드 전체 보기 코드 접기
<script>
import { DsActionButton, DsTheme } from '@conalog/ds-svelte';
let activations = $state(0);
</script>
<DsTheme theme="light">
<div class="sample">
<DsActionButton label="변경 저장" onclick={() => activations++} />
<p role="status">{activations ? '버튼 실행 ' + activations + '회' : ''}</p>
</div>
</DsTheme>
<style>
.sample { display: grid; justify-items: center; align-content: center; gap: var(--site-text-gap, 0.375rem); }
p { min-block-size: 1.2em; margin: 0; color: var(--ds-draft-fg-neutral-muted, currentColor); font-size: var(--site-size-body, 0.8125rem); }
</style>
<script>
import { DsActionButton, DsTheme } from '@conalog/ds-svelte';
let activations = $state(0);
</script>
<DsTheme theme="light">
<div class="sample">
<DsActionButton label="변경 저장" onclick={() => activations++} />
<p role="status">{activations ? '버튼 실행 ' + activations + '회' : ''}</p>
</div>
</DsTheme>
<style>

눌렀을 때 일어나는 일을 라벨로 적습니다. 비동기 처리 중에는 로딩 상태를 연결하고, 폼 안에서 제출할 때만 제출 버튼으로 지정합니다.

변형과 상태

형태

같은 저장 행동을 채움, 약한 채움, 테두리, 면 강조, 전경 강조로 비교합니다.

solid
weak
outline
clear
quiet

코드 보기 코드 접기
<script>
import { DsActionButton, DsTheme } from '@conalog/ds-svelte';
const values = ['solid', 'weak', 'outline', 'clear', 'quiet'];
let activated = $state('');
</script>
<DsTheme theme="light">
<div class="samples">
{#each values as value (value)}
<figure>
<div class="target">
<DsActionButton label="저장" variant={value} onclick={() => activated = value} />
</div>
<figcaption><code>{value}</code></figcaption>
</figure>
{/each}
</div>
<p role="status">{activated && activated + ' 예제를 실행했습니다.'}</p>
</DsTheme>
<style>
.samples { display: flex; flex-wrap: wrap; align-items: start; gap: 0.75rem 1rem; }
figure { display: grid; justify-items: center; gap: 0.25rem; min-inline-size: 3rem; margin: 0; }
.target { display: grid; min-block-size: 2.75rem; place-items: center; }
figcaption { font-size: 0.8125rem; }
p { margin-block: 0.5rem 0; }
p:empty { margin: 0; }
</style>

크기

기본 색과 형태를 유지하면서 xs부터 lg까지 비교합니다.

xs
sm
md
lg

코드 보기 코드 접기
<script>
import { DsActionButton, DsTheme } from '@conalog/ds-svelte';
const values = ['xs', 'sm', 'md', 'lg'];
let activated = $state('');
</script>
<DsTheme theme="light">
<div class="samples">
{#each values as value (value)}
<figure>
<div class="target">
<DsActionButton label="저장" size={value} onclick={() => activated = value} />
</div>
<figcaption><code>{value}</code></figcaption>
</figure>
{/each}
</div>
<p role="status">{activated && activated + ' 예제를 실행했습니다.'}</p>
</DsTheme>
<style>
.samples { display: flex; flex-wrap: wrap; align-items: start; gap: 0.75rem 1rem; }
figure { display: grid; justify-items: center; gap: 0.25rem; min-inline-size: 3rem; margin: 0; }
.target { display: grid; min-block-size: 2.75rem; place-items: center; }
figcaption { font-size: 0.8125rem; }
p { margin-block: 0.5rem 0; }
p:empty { margin: 0; }
</style>

색상

주요, 중립, 위험 행동에 사용할 색 역할을 비교합니다.

primary
neutral
critical

코드 보기 코드 접기
<script>
import { DsActionButton, DsTheme } from '@conalog/ds-svelte';
const values = ['primary', 'neutral', 'critical'];
let activated = $state('');
</script>
<DsTheme theme="light">
<div class="samples">
{#each values as value (value)}
<figure>
<div class="target">
<DsActionButton label="저장" color={value} onclick={() => activated = value} />
</div>
<figcaption><code>{value}</code></figcaption>
</figure>
{/each}
</div>
<p role="status">{activated && activated + ' 예제를 실행했습니다.'}</p>
</DsTheme>
<style>
.samples { display: flex; flex-wrap: wrap; align-items: start; gap: 0.75rem 1rem; }
figure { display: grid; justify-items: center; gap: 0.25rem; min-inline-size: 3rem; margin: 0; }
.target { display: grid; min-block-size: 2.75rem; place-items: center; }
figcaption { font-size: 0.8125rem; }
p { margin-block: 0.5rem 0; }
p:empty { margin: 0; }
</style>

상태

활성 버튼은 행동을 실행하고, 비활성과 로딩은 실행을 막습니다.

enabled
disabled
loading

코드 보기 코드 접기
<script>
import { DsActionButton, DsTheme } from '@conalog/ds-svelte';
const values = ['enabled', 'disabled', 'loading'];
let activated = $state('');
</script>
<DsTheme theme="light">
<div class="samples">
{#each values as value (value)}
<figure>
<div class="target">
<DsActionButton label="저장" presentation={value} onclick={() => activated = value} />
</div>
<figcaption><code>{value}</code></figcaption>
</figure>
{/each}
</div>
<p role="status">{activated && activated + ' 예제를 실행했습니다.'}</p>
</DsTheme>
<style>
.samples { display: flex; flex-wrap: wrap; align-items: start; gap: 0.75rem 1rem; }
figure { display: grid; justify-items: center; gap: 0.25rem; min-inline-size: 3rem; margin: 0; }
.target { display: grid; min-block-size: 2.75rem; place-items: center; }
figcaption { font-size: 0.8125rem; }
p { margin-block: 0.5rem 0; }
p:empty { margin: 0; }
</style>

아이콘 위치

동일한 라벨에 아이콘을 빼거나 앞과 뒤에 붙입니다.

아이콘 없음
라벨 앞
라벨 뒤

코드 보기 코드 접기
<script>
import { DsActionButton, DsTheme } from '@conalog/ds-svelte';
import { CheckFilled } from '@conalog/ds-svelte/icons';
const examples = [
{ id: 'none', label: '아이콘 없음' },
{ id: 'prefix', label: '라벨 앞', icon: CheckFilled, position: 'prefix' },
{ id: 'suffix', label: '라벨 뒤', icon: CheckFilled, position: 'suffix' },
];
let activated = $state('');
</script>
<DsTheme theme="light">
<div class="samples">
{#each examples as { id, label, icon, position } (id)}
<figure>
<div class="target">
<DsActionButton label="저장" {icon} iconPosition={position} onclick={() => activated = label} />
</div>
<figcaption>{label}</figcaption>
</figure>
{/each}
</div>
<p role="status">{activated && activated + ' 예제를 실행했습니다.'}</p>
</DsTheme>
<style>
.samples { display: flex; flex-wrap: wrap; align-items: start; gap: 0.75rem 1rem; }
figure { display: grid; justify-items: center; gap: 0.25rem; min-inline-size: 3rem; margin: 0; }
.target { display: grid; min-block-size: 2.75rem; place-items: center; }
figcaption { font-size: 0.8125rem; }
p { margin-block: 0.5rem 0; }
p:empty { margin: 0; }
</style>

직접 조합해 보기

옵션을 바꾸며 원하는 조합과 눌렀을 때의 동작을 확인합니다.

미리보기

버튼 옵션

크기
ButtonPlayground.svelte

세 파일을 같은 폴더에 저장합니다.

<script>
import { DsActionButton, DsIconButton } from '@conalog/ds-svelte';
import { CheckFilled, SearchOutlined } from '@conalog/ds-svelte/icons';
import PlaygroundLayout from './PlaygroundLayout.svelte';
// Set kind="icon" to preview the Icon Button.
let { kind = 'action' } = $props();
const sizeField = {
key: 'size', label: '크기', segmented: true,
options: ['xs', 'sm', 'md', 'lg'].map(value => ({ value, label: value })),
};
const color = {
key: 'color', label: '색상',
options: [
{ value: 'primary', label: '주요' },
{ value: 'neutral', label: '중립' },
{ value: 'critical', label: '위험' },
],
};
const stateField = {
key: 'state', label: '상태',
options: [
{ value: 'enabled', label: '활성' },
{ value: 'disabled', label: '비활성' },
{ value: 'loading', label: '로딩' },
],
};
const placement = {
key: 'placement', label: '아이콘 위치',
options: [
{ value: 'none', label: '없음' },
{ value: 'prefix', label: '앞' },
{ value: 'suffix', label: '뒤' },
],
};
let action = $derived(kind === 'action');
let fields = $derived([
sizeField,
{
key: 'variant', label: '형태',
options: [
...(action ? [{ value: 'solid', label: '채움' }] : []),
{ value: 'weak', label: '약한 채움' },
{ value: 'outline', label: '외곽선' },
{ value: 'clear', label: '면 강조' },
{ value: 'quiet', label: '전경 강조' },
],
},
values.variant === 'quiet'
? { ...color, options: color.options.filter(option => option.value === 'neutral') }
: color,
stateField, ...(action ? [placement] : []),
]);
let defaults = $derived({
size: 'md',
variant: action ? 'solid' : 'weak',
color: action ? 'primary' : 'neutral',
state: 'enabled',
placement: 'none',
});
let selection = $state({});
let activations = $state(0);
let values = $derived.by(() => {
const options = { ...defaults, ...selection };
return options.variant === 'quiet' ? { ...options, color: 'neutral' } : options;
});
let feedback = $derived(values.state === 'disabled' ? '비활성 상태' :
values.state === 'loading' ? '처리 중' : activations ? `버튼 실행 ${activations}회` : '');
function reset() {
selection = {};
activations = 0;
}
</script>
<PlaygroundLayout title="버튼 옵션" {fields} {values} onchange={(key, value) => selection[key] = value} onreset={reset}>
<div class="button-preview" data-button-preview>
{#if action}
<DsActionButton label="변경 저장"
icon={values.placement === 'none' ? undefined : CheckFilled}
iconPosition={values.placement === 'suffix' ? 'suffix' : 'prefix'}
variant={values.variant} size={values.size} color={values.color}
presentation={values.state} onclick={() => activations++} />
{:else}
<DsIconButton label="검색" icon={SearchOutlined} variant={values.variant}
size={values.size} color={values.color} presentation={values.state} onclick={() => activations++} />
{/if}
<p role="status">{feedback}</p>
</div>
</PlaygroundLayout>
<style>
.button-preview { display: grid; justify-items: center; gap: var(--workbench-gap); }
p { min-block-size: 1lh; margin: 0; font: var(--workbench-support); color: var(--workbench-muted); }
</style>
PlaygroundLayout.svelte
<script>
import { getTokens } from '@conalog/ds-core';
import { DsActionButton, DsSegmentedControl, DsTheme } from '@conalog/ds-svelte';
import NativeSelect from './NativeSelect.svelte';
let { title = '옵션', fields, values, onchange, onreset, wide = false, children } = $props();
const instance = $props.id();
const tokens = getTokens('light');
const token = id => tokens[id].$value;
const font = id => {
const text = token(id);
return `${text['font-weight']} ${text['font-size']}/${text['line-height']} ${text['font-family']}`;
};
</script>
<DsTheme theme="light">
<div class="workbench"
style:--workbench-body={font('type.body')}
style:--workbench-title={font('type.title')}
style:--workbench-support={font('type.sub')}
style:--workbench-ink={token('fg.neutral-contrast')}
style:--workbench-muted={token('fg.neutral')}
style:--workbench-canvas={token('bg.layer-basement')}
style:--workbench-paper={token('bg.layer-floating')}
style:--workbench-border={token('stroke.neutral')}
style:--workbench-radius={token('radius.r2-5')}
style:--workbench-padding={token('spacing.card-edge')}
style:--workbench-gap={token('spacing-y.between-blocks')}
style:--workbench-field-gap={token('spacing-y.between-text')}>
<div class="layout">
<section class="preview" aria-labelledby={instance + '-preview'}>
<h4 id={instance + '-preview'}>미리보기</h4>
<div class={['stage', { wide }]}>
{@render children()}
</div>
</section>
<section class="options" aria-labelledby={instance + '-options'}>
<header>
<h4 id={instance + '-options'}>{title}</h4>
<DsActionButton label="초기화" color="neutral" variant="clear" size="sm" onclick={onreset} />
</header>
<div class="fields">
{#each fields as { key, label, options, segmented } (key)}
<div class={['field', { segmented }]}>
{#if segmented}
<span>{label}</span>
<DsSegmentedControl {label}
items={options.map(option => ({ id: option.value, label: option.label }))}
selected={values[key]} onchange={value => onchange(key, value)} size="md" />
{:else}
<label for={instance + '-' + key}>{label}</label>
<NativeSelect id={instance + '-' + key} name={key} {options} value={values[key]}
onchange={event => onchange(key, event.currentTarget.value)} />
{/if}
</div>
{/each}
</div>
</section>
</div>
</div>
</DsTheme>
<style>
.workbench { container-type: inline-size; color: var(--workbench-ink); font: var(--workbench-body); }
.layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--workbench-padding); }
.preview, .options { min-inline-size: 0; padding: var(--workbench-padding); border: 1px solid var(--workbench-border); border-radius: var(--workbench-radius); }
.preview { display: grid; grid-template-rows: auto 1fr; background: var(--workbench-canvas); }
.stage { display: grid; align-content: center; justify-items: center; gap: var(--workbench-gap); min-block-size: 7rem; }
h4 { margin: 0; font: var(--workbench-title); }
.stage.wide { justify-items: stretch; }
header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--workbench-gap); margin-block-end: var(--workbench-gap); }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--workbench-gap); }
.field { display: grid; align-content: start; gap: var(--workbench-field-gap); min-inline-size: 0; }
.field.segmented { grid-column: 1 / -1; justify-items: start; }
label, .field > span { font: var(--workbench-title); }
@container (min-width: 34rem) {
.layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
}
</style>
NativeSelect.svelte
<script>
import { getTokens } from '@conalog/ds-core';
// Adapted from shadcn-svelte Native Select to use the site's design tokens.
// https://shadcn-svelte.com/docs/components/native-select
let { options, value = $bindable(), docs = false, ...attributes } = $props();
const tokens = getTokens('light');
const token = id => tokens[id].$value;
const text = token('type.body');
const font = `${text['font-weight']} ${text['font-size']}/${text['line-height']} ${text['font-family']}`;
</script>
<div data-slot="native-select-wrapper" class={{ docs }}
style:--select-font={font}
style:--select-bg={token('bg.layer-floating')}
style:--select-hover={token('bg.layer-default-pressed')}
style:--select-color={token('fg.neutral-contrast')}
style:--select-border={token('gray.300')}
style:--select-ring={token('stroke.neutral-focused')}
style:--select-radius={token('radius.r2')}
style:--select-shadow={token('shadow.s2')}
style:--select-height={token('dimension.x9')}
style:--select-touch-height={token('dimension.x11')}
style:--select-padding={token('dimension.x2-5')}
style:--select-icon-size={token('dimension.x1-5')}
style:--select-menu-gap={token('dimension.x1')}>
<select {...attributes} data-slot="native-select" bind:value>
{#each options as option (option.value)}
<option value={option.value} disabled={option.disabled}>{option.label}</option>
{/each}
</select>
<span data-slot="native-select-icon" aria-hidden="true"></span>
</div>
<style>
div { position: relative; min-inline-size: 0; }
div.docs {
--control-bg: var(--site-overlay);
--control-hover: var(--site-inset);
--control-color: var(--site-ink);
--control-border: var(--site-line-strong);
--control-ring: var(--site-accent);
}
select {
appearance: none;
display: block;
min-block-size: var(--select-height);
inline-size: 100%;
border: 1px solid var(--control-border, var(--select-border));
border-radius: var(--select-radius);
padding-inline: var(--select-padding) calc(var(--select-padding) * 3);
background: var(--control-bg, var(--select-bg));
color: var(--control-color, var(--select-color));
font: var(--select-font);
cursor: pointer;
}
select:enabled:hover { border-color: var(--control-ring, var(--select-ring)); }
select:focus-visible { outline: 2px solid var(--control-ring, var(--select-ring)); outline-offset: 2px; }
select:disabled { cursor: not-allowed; opacity: 0.6; }
span {
position: absolute;
inset-inline-end: var(--select-padding);
inset-block-start: 50%;
inline-size: var(--select-icon-size);
block-size: var(--select-icon-size);
border: solid var(--control-ring, var(--select-ring));
border-width: 0 1.5px 1.5px 0;
transform: translateY(-75%) rotate(45deg);
pointer-events: none;
}
@supports (appearance: base-select) and selector(::picker(select)) {
select, select::picker(select) { appearance: base-select; }
select { display: flex; align-items: center; }
select::picker-icon { display: none; }
select::picker(select) {
margin-block: var(--select-menu-gap);
border: 1px solid var(--control-border, var(--select-border));
border-radius: var(--select-radius);
padding: var(--select-menu-gap);
background: var(--control-bg, var(--select-bg));
color: var(--control-color, var(--select-color));
font: var(--select-font);
box-shadow: var(--select-shadow);
}
option { padding: var(--select-menu-gap) var(--select-padding); border-radius: var(--select-menu-gap); }
option:is(:hover, :focus-visible, :checked) { background: var(--control-hover, var(--select-hover)); }
}
@media (pointer: coarse) {
select { min-block-size: var(--select-touch-height); }
}
</style>

디자인 규칙

설계
설계 초안 웹 · 앱 / 화면
구현
실험 구현Svelte · Flutter

구조 미리보기

컨테이너 + 라벨

빠른 참조

공개 API

  • DsActionButton

옵션

이름계약 선택지기본값
color
  • primary
  • neutral
  • critical
미지정
variant
  • solid
  • weak
  • outline
  • clear
  • quiet
  • quiet은 neutral 전용
미지정
size
  • xs
  • sm
  • md
  • lg
md

구성 요소

container
버튼 표면과 일반 경계 및 포커스 외곽선
label
행동 라벨
icon
행동 아이콘
spinner
Loading 시 라벨 또는 아이콘 자리를 대체하는 피드백

상태

  • hovered
  • pressed
  • focused
  • disabled
  • loading

상세 설계

계약 의존성

Button 공통 계약과 Action Button의 세부 규칙을 함께 적용합니다. 공개 옵션과 부위·상태는 계약 JSON에서 확인합니다. 색상과 상태별 토큰은 시각 매핑, 구현 검증 기준은 적합성 확인 조건을 참고합니다.

라벨과 아이콘 구성

컨테이너 안에 prefix 아이콘(선택) · 라벨 · suffix 아이콘(선택)을 나란히 놓습니다.

  • prefix와 suffix 아이콘을 동시에 쓰지 않습니다. 행동의 의미를 거드는 아이콘은 prefix에, 동작 방식을 알리는 아이콘(chevron 등)은 suffix에 둡니다.

  • 아이콘-라벨 정렬은 높이 중앙(web: items-center)에 광학 보정 1px을 더합니다 — 아이콘을 1px 올려 앉힙니다. 단, 원본의 작은 편집 액션 변형은 중앙 정렬을 사용합니다. 한글은 디센더 공간을 쓰지 않아 글자의 시각 중심이 박스 중심보다 위에 있어서, 박스 기준 중앙 정렬만 하면 아이콘이 낮아 보입니다 (iconography.md 정렬 규칙). 작은 편집 액션의 적용 범위는 미결 사항에 기록합니다.

  • 아이콘-라벨 간격은 크기에 관계없이 dimension.x1(4px)을 사용합니다.

형태와 색상 조합

solid(진한 채움), weak(연한 채움), outline(테두리), clear(투명·면 강조), quiet(투명·전경 강조)를 제공합니다. 일반 강조 순서는 solid → weak → outline → clear → quiet입니다. quiet의 색은 neutral이며, 색을 생략하면 같은 값이 적용됩니다. 상시 보조 행동을 따릅니다.

  • primary solid: 화면의 주 행동(CTA).

  • neutral solid: 브랜드색이 과할 때 고대비 CTA의 대안.

  • critical solid: 되돌릴 수 없는 행동의 확인, 주로 다이얼로그 안.

  • primary weak: solid보다 낮은 강조의 브랜드 행동.

  • neutral weak: 면이 보이는 보조 행동의 기본이며 solid의 짝.

  • critical weak: 목록 안 삭제 같은 위험한 보조 행동.

  • primary outline: 병렬 컨트롤 중 강조할 하나.

  • neutral outline: 병렬 조작 또는 단독 드롭다운.

  • clear: 조용한 병렬 행동 무리 전체.

Solid 버튼의 개수
  • solid 셋은 한 화면에 하나만 놓습니다 — 셋 중 무엇이든 그 화면의 주 행동입니다.

색상과 선택 상태의 구분은 공통 규칙 — 참조 절 variant.selection-distinction을 따릅니다.

composition

주 행동은 solid, 취소·건너뛰기 같은 보조 행동은 weak로 두며 행동 쌍은 최대 2개입니다. clear를 solid의 짝으로 쓰지 않습니다. 면이 있는 버튼과 없는 버튼을 나란히 두면 불균형해 보입니다. 병렬 스타일 금지는 공통 composition.parallel — 참조 절 composition.parallel을 따릅니다.

Action Button outline은 두 자리에서만 씁니다.

  1. 3개 이상 동급 컨트롤의 병렬 배치: 대시보드 상단·패널맵 조작 같은 자리에서 무리 전체를 outline으로 통일합니다. 강조할 하나만 primary outline을 사용합니다.

  2. 단독 드롭다운 트리거: suffix chevron을 가진 neutral outline(menu.md). 제목 줄 옆에 혼자 서는 정렬·값 선택 트리거입니다. 표면과 테두리로 입력·선택 어포던스를 나타냅니다. 값이 설정되어도 기본 테두리 토큰을 유지해 선택 상태와 포커스 표현을 구분합니다.

단, 드롭다운 트리거가 weak·clear 컨트롤과 한 줄에 서면 그 줄의 병렬 금지가 우선입니다. card.md 헤더에서는 weak + suffix chevron을 사용합니다. 드롭다운 칩(chip.md)은 목록 위 Filter Bar 전용입니다.

크기 선택

공통 size.layout의 크기 선택 원칙을 따르며, 라벨·아이콘·패딩을 함께 조정합니다.

크기 목록과 기본값은 같은 분류의 contract.json, 시각 값은 styles.json을 참조합니다.

대비 검증
  • 기준 원본 color.md의 primary solid 라벨 대비는 **3.06(hover 4.59)**로 기록되어 있으며, lg의 semibold 보강과 함께 수용한 대비 부채입니다. 본문 크기의 긴 문장을 solid 위에 얹지 않습니다. 대비가 중요한 자리는 neutral solid(bg.neutral-solid)를 우선 검토하고 적용 테마에서 대비를 확인합니다.

  • 기준 원본에서 primary weak(4.0)·critical weak(4.0)의 라벨 대비는 AA(4.5) 미만으로 기록되었습니다. 짧고 medium 이상 굵기의 라벨에 한해 수용한 대비 부채이며, 긴 문장이나 작은 글자를 weak 면 위에 얹지 않습니다. 사용하는 테마와 실제 글자 크기에서 대비를 다시 확인합니다.

짧은 라벨·medium/semibold만으로 일반 텍스트 대비 요건의 예외가 되지 않습니다. 실제 크기·굵기·렌더와 테마별 대비를 검증합니다.

시각 매핑

시각 매핑 원본 보기
{
"contractRef": "component.button.action",
"base": {
"parts": {}
},
"rules": [
{
"id": "all-solid-enabled",
"when": {
"options": {
"variant": "solid"
}
},
"parts": {
"container": {
"backgroundColor": {
"tokenRef": "bg.${options.color}-solid"
},
"border": {
"value": "none"
}
},
"label": {
"color": {
"tokenRef": "fg.neutral-inverted"
}
},
"icon": {
"color": {
"tokenRef": "fg.neutral-inverted"
}
}
}
},
{
"id": "all-solid-hovered",
"when": {
"options": {
"variant": "solid"
},
"states": {
"hovered": true
}
},
"parts": {
"container": {
"backgroundColor": {
"tokenRef": "bg.${options.color}-solid-pressed"
}
}
}
},
{
"id": "all-solid-pressed",
"when": {
"options": {
"variant": "solid"
},
"states": {
"pressed": true
}
},
"parts": {
"container": {
"backgroundColor": {
"tokenRef": "bg.${options.color}-solid-pressed"
}
}
}
},
{
"id": "all-solid-disabled",
"when": {
"options": {
"variant": "solid"
},
"states": {
"disabled": true
}
},
"parts": {
"container": {
"backgroundColor": {
"tokenRef": "bg.neutral-weak"
}
},
"label": {
"color": {
"tokenRef": "fg.disabled"
}
},
"icon": {
"color": {
"tokenRef": "fg.disabled"
}
}
}
},
{
"id": "all-solid-loading",
"when": {
"options": {
"variant": "solid"
},
"states": {
"loading": true
}
},
"parts": {
"container": {
"backgroundColor": {
"tokenRef": "bg.${options.color}-solid"
}
},
"spinner": {
"color": {
"tokenRef": "fg.neutral-inverted"
}
}
}
},
{
"id": "all-solid-focused",
"when": {
"options": {
"variant": "solid"
},
"states": {
"focused": true
}
},
"parts": {
"container": {
"outlineColor": {
"tokenRef": "stroke.neutral-focused"
},
"outlineStyle": {
"value": "solid"
},
"outlineWidth": {
"unit": "px",
"value": 2
},
"outlineOffset": {
"unit": "px",
"value": 2
}
}
}
},
{
"id": "all-weak-enabled",
"when": {
"options": {
"variant": "weak"
}
},
"parts": {
"container": {
"backgroundColor": {
"tokenRef": "bg.${options.color}-weak"
},
"border": {
"value": "none"
}
}
}
},
{
"id": "primary-weak-enabled",
"when": {
"options": {
"variant": "weak",
"color": "primary"
},
"states": {
"disabled": false
}
},
"parts": {
"label": {
"color": {
"tokenRef": "fg.primary-contrast"
}
},
"icon": {
"color": {
"tokenRef": "fg.primary-contrast"
}
}
}
},
{
"id": "neutral-weak-enabled",
"when": {
"options": {
"variant": "weak",
"color": "neutral"
},
"states": {
"disabled": false
}
},
"parts": {
"label": {
"color": {
"tokenRef": "fg.neutral"
}
},
"icon": {
"color": {
"tokenRef": "fg.neutral"
}
}
}
},
{
"id": "critical-weak-enabled",
"when": {
"options": {
"variant": "weak",
"color": "critical"
},
"states": {
"disabled": false
}
},
"parts": {
"label": {
"color": {
"tokenRef": "fg.critical-contrast"
}
},
"icon": {
"color": {
"tokenRef": "fg.critical-contrast"
}
}
}
},
{
"id": "all-weak-hovered",
"when": {
"options": {
"variant": "weak"
},
"states": {
"hovered": true
}
},
"parts": {
"container": {
"backgroundColor": {
"tokenRef": "bg.${options.color}-weak-pressed"
}
}
}
},
{
"id": "all-weak-pressed",
"when": {
"options": {
"variant": "weak"
},
"states": {
"pressed": true
}
},
"parts": {
"container": {
"backgroundColor": {
"tokenRef": "bg.${options.color}-weak-pressed"
}
}
}
},
{
"id": "all-weak-disabled",
"when": {
"options": {
"variant": "weak"
},
"states": {
"disabled": true
}
},
"parts": {
"container": {
"backgroundColor": {
"tokenRef": "bg.neutral-weak"
}
},
"label": {
"color": {
"tokenRef": "fg.disabled"
}
},
"icon": {
"color": {
"tokenRef": "fg.disabled"
}
}
}
},
{
"id": "all-weak-loading",
"when": {
"options": {
"variant": "weak"
},
"states": {
"loading": true
}
},
"parts": {
"container": {
"backgroundColor": {
"tokenRef": "bg.${options.color}-weak"
}
}
}
},
{
"id": "primary-weak-loading",
"when": {
"options": {
"variant": "weak",
"color": "primary"
},
"states": {
"loading": true
}
},
"parts": {
"spinner": {
"color": {
"tokenRef": "fg.primary-contrast"
}
}
}
},
{
"id": "neutral-weak-loading",
"when": {
"options": {
"variant": "weak",
"color": "neutral"
},
"states": {
"loading": true
}
},
"parts": {
"spinner": {
"color": {
"tokenRef": "fg.neutral"
}
}
}
},
{
"id": "critical-weak-loading",
"when": {
"options": {
"variant": "weak",
"color": "critical"
},
"states": {
"loading": true
}
},
"parts": {
"spinner": {
"color": {
"tokenRef": "fg.critical-contrast"
}
}
}
},
{
"id": "all-weak-focused",
"when": {
"options": {
"variant": "weak"
},
"states": {
"focused": true
}
},
"parts": {
"container": {
"outlineColor": {
"tokenRef": "stroke.neutral-focused"
},
"outlineStyle": {
"value": "solid"
},
"outlineWidth": {
"unit": "px",
"value": 2
},
"outlineOffset": {
"unit": "px",
"value": 0
}
}
}
},
{
"id": "all-outline-enabled",
"when": {
"options": {
"variant": "outline"
}
},
"parts": {
"container": {
"backgroundColor": {
"tokenRef": "bg.layer-floating"
},
"borderColor": {
"tokenRef": "stroke.neutral"
},
"borderStyle": {
"value": "solid"
},
"borderWidth": {
"value": 1,
"unit": "px"
}
}
}
},
{
"id": "primary-outline-enabled",
"when": {
"options": {
"variant": "outline",
"color": "primary"
},
"states": {
"disabled": false
}
},
"parts": {
"label": {
"color": {
"tokenRef": "fg.primary-contrast"
}
},
"icon": {
"color": {
"tokenRef": "fg.primary-contrast"
}
}
}
},
{
"id": "neutral-outline-enabled",
"when": {
"options": {
"variant": "outline",
"color": "neutral"
},
"states": {
"disabled": false
}
},
"parts": {
"label": {
"color": {
"tokenRef": "fg.neutral"
}
},
"icon": {
"color": {
"tokenRef": "fg.neutral"
}
}
}
},
{
"id": "all-outline-hovered",
"when": {
"options": {
"variant": "outline"
},
"states": {
"hovered": true
}
},
"parts": {
"container": {
"backgroundColor": {
"tokenRef": "bg.layer-floating-pressed"
}
}
}
},
{
"id": "all-outline-pressed",
"when": {
"options": {
"variant": "outline"
},
"states": {
"pressed": true
}
},
"parts": {
"container": {
"backgroundColor": {
"tokenRef": "bg.layer-floating-pressed"
}
}
}
},
{
"id": "all-outline-disabled",
"when": {
"options": {
"variant": "outline"
},
"states": {
"disabled": true
}
},
"parts": {
"container": {
"backgroundColor": {
"tokenRef": "bg.layer-floating"
},
"borderColor": {
"tokenRef": "stroke.neutral"
}
},
"label": {
"color": {
"tokenRef": "fg.disabled"
}
},
"icon": {
"color": {
"tokenRef": "fg.disabled"
}
}
}
},
{
"id": "all-outline-loading",
"when": {
"options": {
"variant": "outline"
},
"states": {
"loading": true
}
},
"parts": {
"container": {
"backgroundColor": {
"tokenRef": "bg.layer-floating"
},
"borderColor": {
"tokenRef": "stroke.neutral"
}
}
}
},
{
"id": "primary-outline-loading",
"when": {
"options": {
"variant": "outline",
"color": "primary"
},
"states": {
"loading": true
}
},
"parts": {
"spinner": {
"color": {
"tokenRef": "fg.primary-contrast"
}
}
}
},
{
"id": "neutral-outline-loading",
"when": {
"options": {
"variant": "outline",
"color": "neutral"
},
"states": {
"loading": true
}
},
"parts": {
"spinner": {
"color": {
"tokenRef": "fg.neutral"
}
}
}
},
{
"id": "all-outline-focused",
"when": {
"options": {
"variant": "outline"
},
"states": {
"focused": true
}
},
"parts": {
"container": {
"outlineColor": {
"tokenRef": "stroke.neutral-focused"
},
"outlineStyle": {
"value": "solid"
},
"outlineWidth": {
"unit": "px",
"value": 2
},
"outlineOffset": {
"unit": "px",
"value": 0
}
}
}
},
{
"id": "size-web-xs",
"when": {
"options": {
"size": "xs"
},
"platform": "web"
},
"parts": {
"container": {
"height": {
"tokenRef": "dimension.x6"
},
"paddingInline": {
"tokenRef": "dimension.x2"
},
"borderRadius": {
"tokenRef": "radius.r1-5"
},
"columnGap": {
"tokenRef": "dimension.x1"
}
},
"label": {
"typography": {
"tokenRef": "type.sub"
}
},
"icon": {
"width": {
"tokenRef": "dimension.x3-5"
},
"height": {
"tokenRef": "dimension.x3-5"
}
}
}
},
{
"id": "size-web-sm",
"when": {
"options": {
"size": "sm"
},
"platform": "web"
},
"parts": {
"container": {
"height": {
"tokenRef": "dimension.x6"
},
"paddingInline": {
"tokenRef": "dimension.x2"
},
"borderRadius": {
"tokenRef": "radius.r1-5"
},
"columnGap": {
"tokenRef": "dimension.x1"
}
},
"icon": {
"width": {
"tokenRef": "dimension.x3-5"
},
"height": {
"tokenRef": "dimension.x3-5"
}
},
"label": {
"typography": {
"tokenRef": "type.sub"
}
}
}
},
{
"id": "size-web-md",
"when": {
"options": {
"size": "md"
},
"platform": "web"
},
"parts": {
"container": {
"height": {
"tokenRef": "dimension.x7"
},
"paddingInline": {
"tokenRef": "dimension.x2-5"
},
"borderRadius": {
"tokenRef": "radius.r2"
},
"columnGap": {
"tokenRef": "dimension.x1"
}
},
"label": {
"typography": {
"tokenRef": "type.body"
}
},
"icon": {
"width": {
"tokenRef": "dimension.x4"
},
"height": {
"tokenRef": "dimension.x4"
}
}
}
},
{
"id": "size-web-lg",
"when": {
"options": {
"size": "lg"
},
"platform": "web"
},
"parts": {
"container": {
"height": {
"tokenRef": "dimension.x8"
},
"paddingInline": {
"tokenRef": "dimension.x3"
},
"borderRadius": {
"tokenRef": "radius.r2"
},
"columnGap": {
"tokenRef": "dimension.x1"
}
},
"icon": {
"width": {
"tokenRef": "dimension.x4"
},
"height": {
"tokenRef": "dimension.x4"
}
},
"label": {
"typography": {
"tokenRef": "type.body"
}
}
}
},
{
"id": "size-app-xs",
"when": {
"options": {
"size": "xs"
},
"platform": "app"
},
"parts": {
"container": {
"height": {
"tokenRef": "dimension.x8"
},
"paddingInline": {
"tokenRef": "dimension.x2-5"
},
"borderRadius": {
"tokenRef": "radius.r2"
},
"columnGap": {
"tokenRef": "dimension.x1"
}
},
"label": {
"typography": {
"tokenRef": "type.m-sub"
}
},
"icon": {
"width": {
"tokenRef": "dimension.x4"
},
"height": {
"tokenRef": "dimension.x4"
}
}
}
},
{
"id": "size-app-sm",
"when": {
"options": {
"size": "sm"
},
"platform": "app"
},
"parts": {
"container": {
"height": {
"tokenRef": "dimension.x10"
},
"paddingInline": {
"tokenRef": "dimension.x3"
},
"borderRadius": {
"tokenRef": "radius.r2"
},
"columnGap": {
"tokenRef": "dimension.x1"
}
},
"label": {
"typography": {
"tokenRef": "type.m-body"
}
},
"icon": {
"width": {
"tokenRef": "dimension.x4"
},
"height": {
"tokenRef": "dimension.x4"
}
}
}
},
{
"id": "size-app-md",
"when": {
"options": {
"size": "md"
},
"platform": "app"
},
"parts": {
"container": {
"height": {
"tokenRef": "dimension.x12"
},
"paddingInline": {
"tokenRef": "dimension.x4"
},
"borderRadius": {
"tokenRef": "radius.r3"
},
"columnGap": {
"tokenRef": "dimension.x1"
}
},
"label": {
"typography": {
"tokenRef": "type.m-control"
}
},
"icon": {
"width": {
"tokenRef": "dimension.x5"
},
"height": {
"tokenRef": "dimension.x5"
}
}
}
},
{
"id": "size-app-lg",
"when": {
"options": {
"size": "lg"
},
"platform": "app"
},
"parts": {
"container": {
"height": {
"tokenRef": "dimension.x14"
},
"paddingInline": {
"tokenRef": "dimension.x5"
},
"borderRadius": {
"tokenRef": "radius.r3"
},
"columnGap": {
"tokenRef": "dimension.x1"
}
},
"label": {
"typography": {
"tokenRef": "type.m-control"
}
},
"icon": {
"width": {
"tokenRef": "dimension.x5"
},
"height": {
"tokenRef": "dimension.x5"
}
}
}
},
{
"id": "critical-outline-enabled",
"when": {
"options": {
"variant": "outline",
"color": "critical"
},
"states": {
"disabled": false
}
},
"parts": {
"icon": {
"color": {
"tokenRef": "fg.critical-contrast"
}
},
"label": {
"color": {
"tokenRef": "fg.critical-contrast"
}
}
}
},
{
"id": "critical-outline-loading",
"when": {
"options": {
"variant": "outline",
"color": "critical"
},
"states": {
"loading": true
}
},
"parts": {
"spinner": {
"color": {
"tokenRef": "fg.critical-contrast"
}
}
}
},
{
"id": "all-clear-enabled",
"when": {
"options": {
"variant": "clear"
}
},
"parts": {
"container": {
"backgroundColor": {
"value": "transparent"
},
"border": {
"value": "none"
}
}
}
},
{
"id": "all-clear-hovered",
"when": {
"options": {
"variant": "clear"
},
"states": {
"hovered": true,
"disabled": false,
"loading": false
}
},
"parts": {
"container": {
"backgroundColor": {
"tokenRef": "bg.layer-default-pressed"
}
}
}
},
{
"id": "all-clear-pressed",
"when": {
"options": {
"variant": "clear"
},
"states": {
"pressed": true,
"disabled": false,
"loading": false
}
},
"parts": {
"container": {
"backgroundColor": {
"tokenRef": "bg.layer-default-pressed"
}
}
}
},
{
"id": "all-clear-disabled",
"when": {
"options": {
"variant": "clear"
},
"states": {
"disabled": true
}
},
"parts": {
"icon": {
"color": {
"tokenRef": "fg.disabled"
}
},
"label": {
"color": {
"tokenRef": "fg.disabled"
}
}
}
},
{
"id": "all-clear-focused",
"when": {
"options": {
"variant": "clear"
},
"states": {
"focused": true
}
},
"parts": {
"container": {
"outlineColor": {
"tokenRef": "stroke.neutral-focused"
},
"outlineStyle": {
"value": "solid"
},
"outlineWidth": {
"value": 2,
"unit": "px"
},
"outlineOffset": {
"value": 0,
"unit": "px"
}
}
}
},
{
"id": "primary-clear-enabled",
"when": {
"options": {
"variant": "clear",
"color": "primary"
},
"states": {
"disabled": false
}
},
"parts": {
"icon": {
"color": {
"tokenRef": "fg.primary-contrast"
}
},
"label": {
"color": {
"tokenRef": "fg.primary-contrast"
}
},
"spinner": {
"color": {
"tokenRef": "fg.primary-contrast"
}
}
}
},
{
"id": "neutral-clear-enabled",
"when": {
"options": {
"variant": "clear",
"color": "neutral"
},
"states": {
"disabled": false
}
},
"parts": {
"icon": {
"color": {
"tokenRef": "fg.neutral"
}
},
"label": {
"color": {
"tokenRef": "fg.neutral"
}
},
"spinner": {
"color": {
"tokenRef": "fg.neutral"
}
}
}
},
{
"id": "critical-clear-enabled",
"when": {
"options": {
"variant": "clear",
"color": "critical"
},
"states": {
"disabled": false
}
},
"parts": {
"icon": {
"color": {
"tokenRef": "fg.critical-contrast"
}
},
"label": {
"color": {
"tokenRef": "fg.critical-contrast"
}
},
"spinner": {
"color": {
"tokenRef": "fg.critical-contrast"
}
}
}
},
{
"id": "quiet-base",
"when": {
"options": {
"variant": "quiet"
}
},
"parts": {
"container": {
"backgroundColor": {
"value": "transparent"
},
"border": {
"value": "none"
}
},
"label": {
"color": {
"tokenRef": "fg.neutral-muted"
}
},
"icon": {
"color": {
"tokenRef": "fg.neutral-muted"
}
}
}
},
{
"id": "quiet-disabled",
"when": {
"options": {
"variant": "quiet"
},
"states": {
"disabled": true
}
},
"parts": {
"label": {
"color": {
"tokenRef": "fg.disabled"
}
},
"icon": {
"color": {
"tokenRef": "fg.disabled"
}
}
}
},
{
"id": "quiet-loading",
"when": {
"options": {
"variant": "quiet"
},
"states": {
"loading": true
}
},
"parts": {
"spinner": {
"color": {
"tokenRef": "fg.neutral-muted"
}
}
}
},
{
"id": "quiet-hovered",
"when": {
"options": {
"variant": "quiet"
},
"states": {
"hovered": true,
"loading": false
}
},
"parts": {
"label": {
"color": {
"tokenRef": "fg.neutral"
}
},
"icon": {
"color": {
"tokenRef": "fg.neutral"
}
}
}
},
{
"id": "quiet-pressed",
"when": {
"options": {
"variant": "quiet"
},
"states": {
"pressed": true,
"loading": false
}
},
"parts": {
"label": {
"color": {
"tokenRef": "fg.neutral"
}
},
"icon": {
"color": {
"tokenRef": "fg.neutral"
}
}
}
},
{
"id": "quiet-focused",
"when": {
"options": {
"variant": "quiet"
},
"states": {
"focused": true,
"loading": false
}
},
"parts": {
"label": {
"color": {
"tokenRef": "fg.neutral"
}
},
"icon": {
"color": {
"tokenRef": "fg.neutral"
}
}
}
},
{
"id": "quiet-focus-ring",
"when": {
"options": {
"variant": "quiet"
},
"states": {
"focused": true
}
},
"parts": {
"container": {
"outlineColor": {
"tokenRef": "stroke.neutral-focused"
},
"outlineStyle": {
"value": "solid"
},
"outlineWidth": {
"value": 2,
"unit": "px"
},
"outlineOffset": {
"value": 0,
"unit": "px"
}
}
}
}
]
}

적합성 확인

검증 조건과 기대 결과 보기

Button 읽기 안내

Action Button 적합성

기준: Action Button 계약, 공통 계약, 시각 매핑. 공개 옵션의 유효 조합과 web/app 플랫폼의 필수 값을 확인합니다.

실험 패키지의 웹 sm·lg 라벨은 각각 type.sub·type.body를 적용합니다. 테두리형 공통 선과 투명형의 색·상태는 Core 토큰을 사용하며 작게 표시되는 라벨과 색 대비를 다음 디자인 검토에서 확인합니다.

검증 기록: 대상 구현 / 레이아웃 / 입력 수단 / 브라우저 또는 OS / 테마 / 글자 배율 / 실행일 / 결과·증거. 플랫폼별 미결 사항을 함께 확인합니다.

  • [ ] 구성 스냅샷·접근성 트리: prefix/suffix 동시 사용 금지, 중앙 정렬+아이콘 위 1px, 간격 4. component.button.action#anatomy.action-button

  • [ ] color·variant 조합 및 한 화면 solid 하나 제한을 조사한다. component.button.action#variant.matrix, component.button.action#variant.solid.quantity

  • [ ] solid+weak 쌍, clear 무리, outline 다중 컨트롤과 단독/헤더 드롭다운을 비교한다. component.button.action#composition, component.button.common#composition.parallel

  • [ ] 상시 보조 행동의 quiet은 중립색 조합만 허용한다. 기본 전경, 호버·누름·포커스의 전경, 투명한 면과 2px 키보드 포커스 외곽선을 확인한다. component.button.common#composition.quiet

  • [ ] 라벨의 대상·행동·문체와 critical 확인의 실제 결과를 대조한다. component.button.common#content.label

  • [ ] primary solid/weak·critical weak의 기존 대비 부채와 긴 문장·작은 글자 제한을 확인한다. component.button.action#debt.contrast

  • [ ] Enabled·Disabled·Loading 중 단일 표현 상태와 원시 Hovered·Pressed·Focused 입력, 공통 해석 후 적용 상태를 함께 기록한다. 허용된 조합을 캡처해 base와 모든 일치 규칙의 속성별 합성 결과와 비교한다. Enabled·Disabled·Loading은 같은 축에서 하나만 선택하고, 둘 이상을 함께 적용하는 경우를 허용하지 않는지 확인한다. options·platform·states의 고정 우선순위나 배열 순서를 사용하지 않고 false 조건도 비교하며 미해소 충돌을 오류로 검출한다. component.button.common#state.interpretation, component.button.common#state.mapping, component.button.common#state.focused.presentation

  • [ ] Disabled에서 입력별 활성화와 시각 변화 이벤트를 기록한다. Tab 순차 탐색 제외·활성화 차단·명시된 비활성 색을 확인한다. component.button.common#state.disabled.activation

  • [ ] Selected 기능을 Toggle Button·Segmented Control·Chip으로 분리했는지 확인한다. component.button.common#state.selected.absence

  • [ ] 로딩 전후 폭·Enabled 색·접근성 트리·중복 동작 이벤트를 비교한다. 포인터가 위에 있거나 press 입력이 남아 있어도 Hovered·Pressed 표현을 적용하지 않는지, 포인터·키보드·보조기술 경로의 중복 활성화를 차단하는지 확인한다. 스피너·기존 포커스와 필요한 외곽선 유지·Tab 이탈·web aria-busy도 확인한다. component.button.common#state.interpretation, component.button.common#state.loading

  • [ ] 실제 렌더의 대비, 다크·고대비·강제 색상, 글자 배율·긴 번역·RTL·overflow를 확인한다. 미정 매핑은 통과로 간주하지 않는다. 미결 사항

  • [ ] 표현 상태가 Enabled인 동안 Focused와 Hovered·Pressed가 공존하면 외곽선은 유지되고 배경은 조작 상태를 따르는지 확인한다. Loading 진입 후 원시 hover/press와 관계없이 기존 포커스·필요한 외곽선과 Tab 이탈을 확인한다. component.button.common#state.interpretation, component.button.common#state.focused.presentation, component.button.common#state.loading

  • [ ] xs·sm·md·lg와 기본 md를 검증한다. web에는 모바일 브라우저를 포함한다. 공개 size에 필수 값이 없으면 커버리지 오류로 검출하고 md로 자동 대체하지 않는다. component.button.action#size.selection

  • [ ] 요청 진행 중 폼 조건·권한이 바뀌거나 작업이 완료·실패하는 실제 흐름에서 외부 조건을 바탕으로 배타적인 표현 상태 하나를 선택하는 전이와 정보 전달을 검토한다. 별도 외부 정보가 필요해도 Enabled·Disabled·Loading을 동시에 적용하지 않는다. Disabled 포커스 전이와 누른 도중 표현 상태가 바뀔 때의 취소·해제는 정책을 확정한 뒤 검증한다. 공통 해석을 실제 UI·미리보기·검증에 일관되게 적용하고 미결 항목은 통과로 세지 않는다. 검토 사항

저장소 원본 core/components/button/action-button/contract.md