Featuring Design System
Legacy

CoreButton

레거시 버튼 컴포넌트. Button으로 마이그레이션을 권장합니다.

개요

마이그레이션 안내 — 이 컴포넌트는 레거시입니다. 신규 프로젝트에서는 Button을 사용하세요.

CoreButton은 단일 props 기반 버튼 컴포넌트입니다.

  • 4가지 buttonTypeprimary, secondary, tertiary, contrast
  • 5가지 sizexs, sm, md, lg, xl
  • isDanger — 위험 동작에 빨간색 시각 처리
  • isLoading — 로딩 상태에서 콘텐츠를 숨기고 스피너 표시
  • isRoundedborder-radius: full 적용
  • prefix / suffix — 버튼 앞뒤에 아이콘 배치

Usage

기본 사용법

<HStack $css={{ gap: '8px' }}>
<CoreButton text="Primary" buttonType="primary" />
<CoreButton text="Secondary" buttonType="secondary" />
<CoreButton text="Tertiary" buttonType="tertiary" />
<CoreButton text="Contrast" buttonType="contrast" />
</HStack>

크기 설정

<HStack $css={{ gap: '8px', alignItems: 'center' }}>
<CoreButton text="xs" size="xs" />
<CoreButton text="sm" size="sm" />
<CoreButton text="md" size="md" />
<CoreButton text="lg" size="lg" />
<CoreButton text="xl" size="xl" />
</HStack>

아이콘과 함께

<HStack $css={{ gap: '8px' }}>
<CoreButton text="Prefix" prefix={<IconAddOutline />} />
<CoreButton text="Suffix" suffix={<IconCaretDownFilled />} />
<CoreButton prefix={<IconAddOutline />} />
</HStack>

위험 버튼 (Danger)

<HStack $css={{ gap: '8px' }}>
<CoreButton text="Delete" buttonType="primary" isDanger />
<CoreButton text="Delete" buttonType="secondary" isDanger />
<CoreButton text="Delete" buttonType="tertiary" isDanger />
</HStack>

로딩 및 비활성화 상태

<HStack $css={{ gap: '8px' }}>
<CoreButton text="Loading" isLoading />
<CoreButton text="Disabled" disabled />
</HStack>

너비와 둥근 버튼

<VStack $css={{ gap: '8px' }}>
<CoreButton text="Fixed Width" buttonType="secondary" width={200} />
<CoreButton text="Full Width" buttonType="tertiary" width="100%" />
<CoreButton text="Rounded" prefix={<IconAddOutline />} isRounded />
</VStack>

Props

ComponentPropsWithoutRef<'button'>을 확장한 컴포넌트입니다.

Prop

Type

CoreButtonType

Prop

Type

CoreButtonSize

Prop

Type

스타일

Size Variants

SizeHeightPadding XIcon SizeTypography
xs20px10px14pxheading[1]
sm24px10px16pxheading[1]
md32px12px16pxheading[2]
lg40px16px20pxheading[2]
xl48px24px20pxheading[3]

아이콘만 있는 버튼은 height와 동일한 정사각형 크기로 렌더링됩니다.

Button Type — 상태별 토큰

TypeDefaultHoverDisabled
primarybutton-primary bgbutton-primary-hover bgbutton-disabled-bg
secondarybutton-secondary bgbutton-secondary-hover bgbutton-disabled-bg
tertiarybutton-tertiary-bg + borderbutton-tertiary-hover bgbutton-tertiary-bg + disabled border
contrasttransparent + button-contrast textbutton-contrast-hover-bg bgtransparent + button-disabled-text

마이그레이션 가이드

Button 컴포넌트로 전환하면 Compound composition 패턴, 반응형 size, render prop을 활용할 수 있습니다.

Before / After

// Before (CoreButton)
<CoreButton
  text="저장"
  buttonType="primary"
  prefix={<IconAddOutline />}
  size="md"
  isLoading
/>
// After (Button)
<Button.Root buttonType="primary" size="md" loading>
  <Button.Icon><IconAddOutline /></Button.Icon>
  <Button.Text>저장</Button.Text>
</Button.Root>

변경 사항

CoreButtonButton
text propButton.Text 서브컴포넌트
prefix / suffixButton.Icon 서브컴포넌트
isLoadingloading
isRounded$css={{ borderRadius: 'radius-full' }}
isDangerisDanger (동일)
width prop$css={{ width: '...' }}