콘텐츠로 이동
RefineUI

Button

저장, 계속, 패널 열기, 다이얼로그 닫기 등 액션을 시작합니다.

Overview

Machine-readable contract from Component Spec.

component: buttonexport: Buttonversion: 1recipe: buttontokens.visual: buttonattributes: data-refineui=button

Anatomy

Partdata-refineui
rootbutton
iconoptional
labelrequired

Variants

AxisValues
variantprimary, secondary, outline, ghost
sizesm, md, lg
layoutlabel, icon

States

ScopeCategoryValues
componentpseudohover, active, focus-visible
componentcomponentdata-state: loading
componentavailabilitydisabled, aria-disabled, data-inactive
componentenvironmentforced-colors, dir, prefers-contrast
buttonpseudohover, active, focus-visible
buttoncomponentdata-state: loading
buttonavailabilitydisabled, aria-disabled, data-inactive

Accessibility

SlotElementNative
buttonbuttontrue

Keyboard

KeyActionNative
Enteractivatetrue
Spaceactivatetrue

Focus

SectionPropertyValue
visualrequiredtrue
visualselector:focus-visible

Layout

PropertyValue
directionlogical
rtltrue

Variant

Select a recipe variant — preview and Recipe → Tokens update together.

Recipe → Tokens

Slot bindings for variant="primary" — declared in button.recipe.ts.

SlotVariantPropertyTraceSemanticLight → foundationDark → foundationRecipe class
rootprimarybackgroundbutton.primary.backgroundbackgroundBrandprimaryBlackprimaryGraybg-refineui-alias-background-brand
rootprimaryforegroundbutton.primary.foregroundforegroundOnBrandneutralWhiteneutralBlacktext-refineui-alias-foreground-inversed

Component token trace

All paths in token-trace-v2.json prefixed with button.

TraceSemanticLight foundationDark foundationLightDark
button.ghost.activeBackgroundbackgroundPrimaryActiveneutral150neutral800#F0F0F0#2A2A2A
button.ghost.activeForegroundforegroundPrimaryprimaryBlackneutralWhite#212121#FFFFFF
button.ghost.disabledForegroundforegroundDisabledneutral400neutral600#CECECE#6C6C6C
button.ghost.foregroundforegroundPrimaryprimaryBlackneutralWhite#212121#FFFFFF
button.ghost.hoverBackgroundbackgroundPrimaryHoverneutral100neutral850#F5F5F5#222222
button.ghost.hoverForegroundforegroundPrimaryHoverneutralBlackneutral100#000000#F5F5F5
button.outline.activeBorderborderStrongneutral450neutral550#BBBBBB#8D8D8D
button.outline.borderborderDefaultneutral300neutral650#DBDBDB#5B5B5B
button.outline.disabledBorderborderDisabledneutral250neutral700#E0E0E0#404040
button.outline.disabledForegroundforegroundDisabledneutral400neutral600#CECECE#6C6C6C
button.outline.foregroundforegroundPrimaryprimaryBlackneutralWhite#212121#FFFFFF
button.outline.hoverBorderborderStrongneutral450neutral550#BBBBBB#8D8D8D
button.primary.activeBackgroundbackgroundBrandActiveneutralBlackprimaryLightGray#000000#E6E6E6
button.primary.appearance.backgroundbackgroundBrandprimaryBlackprimaryGray#212121#D4D4D4
button.primary.appearance.foregroundforegroundOnBrandneutralWhiteneutralBlack#FFFFFF#000000
button.primary.backgroundbackgroundBrandprimaryBlackprimaryGray#212121#D4D4D4
button.primary.disabledBackgroundbackgroundBrandDisabledneutral150neutral650#F0F0F0#5B5B5B
button.primary.disabledForegroundforegroundDisabledneutral400neutral600#CECECE#6C6C6C
button.primary.foregroundforegroundOnBrandneutralWhiteneutralBlack#FFFFFF#000000
button.primary.hoverBackgroundbackgroundBrandHoverprimaryDarkGrayprimaryLightGray#4d4d4d#E6E6E6
button.primary.states.disabled.backgroundbackgroundBrandDisabledneutral150neutral650#F0F0F0#5B5B5B
button.primary.states.disabled.foregroundforegroundDisabledneutral400neutral600#CECECE#6C6C6C
button.primary.states.hover.backgroundbackgroundBrandHoverprimaryDarkGrayprimaryLightGray#4d4d4d#E6E6E6
button.primary.states.pressed.backgroundbackgroundBrandActiveneutralBlackprimaryLightGray#000000#E6E6E6
button.secondary.activeBackgroundbackgroundSurfaceActiveneutral150neutral700#F0F0F0#404040
button.secondary.backgroundbackgroundPrimaryneutralWhiteneutral900#FFFFFF#1A1A1A
button.secondary.borderborderDefaultneutral300neutral650#DBDBDB#5B5B5B
button.secondary.disabledBackgroundbackgroundSurfaceDisabledneutral150neutral850#F0F0F0#222222
button.secondary.disabledBorderborderDisabledneutral250neutral700#E0E0E0#404040
button.secondary.disabledForegroundforegroundDisabledneutral400neutral600#CECECE#6C6C6C
button.secondary.foregroundforegroundPrimaryprimaryBlackneutralWhite#212121#FFFFFF
button.secondary.hoverBackgroundbackgroundSurfaceHoverneutral100neutral750#F5F5F5#333333
button.secondary.hoverBorderborderStrongneutral450neutral550#BBBBBB#8D8D8D
npm install @refineui/react @refineui/tokens

뷰당 기본(primary) 액션은 하나만 사용하세요. 밀집된 툴바의 보조 액션에는 ghost 또는 outline을 권장합니다.

import { Button, WebIcon } from "@refineui/react";
import { iconSizes } from "@refineui/tokens";
<Button variant="primary" size="md">
Continue
</Button>
<Button variant="outline" disabled>
Unavailable
</Button>
<Button variant="ghost" layout="icon" aria-label="Add">
<WebIcon name="add" size={iconSizes.medium} color="currentColor" />
</Button>

계약 소스: packages/react/spec/components/button.json — 위의 SpecRenderer로 렌더링됩니다.