Aller au contenu principal

Bouton

Bouton d'action courant, prenant en charge plusieurs types, tailles, états et couleurs de thème style chinois.

Utilisation de base​

Utilisation de base
import { LhButton } from '@lh-ui/react'

export default function Demo() {
return (
<>
<LhButton>Par défaut</LhButton>
<LhButton type="primary">Principal</LhButton>
<LhButton type="success">Succès</LhButton>
<LhButton type="warning">Avertissement</LhButton>
<LhButton type="danger">Danger</LhButton>
<LhButton type="info">Information</LhButton>
</>
)
}

Tailles et états​

Tailles et états
import { LhButton } from '@lh-ui/react'

export default function Demo() {
return (
<>
<LhButton size="large">Grand</LhButton>
<LhButton>Par défaut</LhButton>
<LhButton size="small">Petit</LhButton>

<LhButton type="primary" loading>Chargement</LhButton>
<LhButton type="primary" disabled>Désactivé</LhButton>
<LhButton type="primary" icon="search">Icône</LhButton>
<LhButton type="primary" round>Arrondi</LhButton>
<LhButton type="primary" plain>Plain</LhButton>
</>
)
}

Button Props​

PropDescriptionTypeOptionsValeur par défaut
typeType de bouton'text' | 'primary' | 'success' | 'warning' | 'danger' | 'info'—'text'
sizeTaille'large' | 'middle' | 'small'—Selon ConfigProvider
loadingÉtat de chargementboolean—false
disabledÉtat désactivéboolean—false
plainVariante plainboolean—false
blockPleine largeur (width 100%)boolean—false
roundCoins arrondisboolean—false
circleCirculaireboolean—false
iconNom de l'icôneLhIconName——
nativeTypeAttribut type natif'button' | 'submit' | 'reset'—'button'
hrefRendu sous forme de <a> lorsqu'il est fournistring——
targettarget en mode hrefstring——
themeVarsVariables de thème au niveau du composantRecord<string, string>——
bgPatternMotif de fond au niveau du composantstring——
sxRaccourci de mise en pageSxProps——

Événements de Button​

ÉvénementDescriptionSignature du rappelÉquivalent Vue
onClickDéclenché au clic (pas déclenché à l'état désactivé / en chargement)(event: MouseEvent) => void@click

Styles​

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