메인 콘텐츠로 건너뛰기

Button 버튼

자주 사용하는 작업 버튼으로, 다양한 타입, 크기, 상태 및 중국풍 테마 색상을 지원합니다.

기본 사용법​

기본 사용법
import { LhButton } from '@lh-ui/react'

export default function Demo() {
return (
<>
<LhButton>기본 버튼</LhButton>
<LhButton type="primary">주요 버튼</LhButton>
<LhButton type="success">성공 버튼</LhButton>
<LhButton type="warning">경고 버튼</LhButton>
<LhButton type="danger">위험 버튼</LhButton>
<LhButton type="info">정보 버튼</LhButton>
</>
)
}

크기와 상태​

크기와 상태
import { LhButton } from '@lh-ui/react'

export default function Demo() {
return (
<>
<LhButton size="large">대형 버튼</LhButton>
<LhButton>기본 버튼</LhButton>
<LhButton size="small">소형 버튼</LhButton>

<LhButton type="primary" loading>로딩 중</LhButton>
<LhButton type="primary" disabled>비활성화 상태</LhButton>
<LhButton type="primary" icon="search">아이콘 버튼</LhButton>
<LhButton type="primary" round>둥근 버튼</LhButton>
<LhButton type="primary" plain>아웃라인 버튼</LhButton>
</>
)
}

Button Props​

프로퍼티설명타입선택 가능한 값기본값
type버튼 타입'text' | 'primary' | 'success' | 'warning' | 'danger' | 'info'—'text'
size크기'large' | 'middle' | 'small'—ConfigProvider 따름
loading로딩 중 상태boolean—false
disabled비활성화 상태boolean—false
plain아웃라인 형태boolean—false
block전체 너비 (폭 100%)boolean—false
round둥근 모서리boolean—false
circle원형boolean—false
icon아이콘 이름LhIconName——
nativeType기본 type 속성'button' | 'submit' | 'reset'—'button'
href전달 시 <a>로 렌더링string——
targethref 모드의 targetstring——
themeVars컴포넌트 수준 테마 변수Record<string, string>——
bgPattern컴포넌트 수준 배경 문양string——
sx빠른 레이아웃 프로퍼티SxProps——

Button 이벤트​

이벤트설명콜백 시그니처Vue 대응
onClick클릭 시 발생 (disabled / loading일 때는 발생하지 않음)(event: MouseEvent) => void@click

스타일​

import '@lh-ui/react/style/button'