メインコンテンツへスキップ

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'