Panoramica
Usa il componente condivisoLightButton per un’azione leggera. Compone
Button con una superficie ghost, dimensioni ridotte, peso
del carattere normale e nessuna elevazione.
Utilizzo
Opzioni visive
Confronta l’enfasi standard e discreta nei comuni stati delle azioni.Gestione dello stato
LightButton usa il modello di stato di Button e non aggiunge alcuno stato proprio. La tua applicazione fornisce loading e disabled; emphasis modifica solo l’aspetto. Consulta l’esempio di gestione dello stato di Button per gestire un’azione asincrona. Non sono disponibili modalità di selezione controllata e non controllata.
Enfasi e icone
emphasis="standard" usa testo neutro secondario.
emphasis="subtle" usa testo neutro terziario su superfici ghost, outline e
soft. I colori semantici e le superfici solide mantengono il rispettivo trattamento del contrasto.
Sostituisci variant, color, size o elevated quando necessario.
ButtonGroup può impostare dimensione, superficie
e colore condivisi. L’aspetto esplicito dell’elemento figlio ha la precedenza sul gruppo, seguito dai
valori predefiniti del componente. L’enfasi discreta non sostituisce il colore semantico.
Interazione
LightButton accetta gli attributi nativi di Button, refs, gestori di eventi, slot
delle icone, stati di caricamento e disabilitato e composizione di render. Il valore predefinito nativo
è type="button". Imposta type="submit" per l’invio oppure usa href per un link.
Fornisci render per scegliere una radice personalizzata, incluso un link del router di proprietà dell’applicazione. Imposta nativeButton={false} e role="link" per un renderer di navigazione.
I pulsanti nativi personalizzati mantengono nativeButton su true.
Props
CSS class applied to the element, or a function that
returns a class based on the component’s state.
Semantic color of the button.
inherit uses the surrounding text color for the label, icons, loader, and outline border, with translucent black interaction surfaces. It supports outline, ghost, soft, and link. Resolving solid with inherit throws, including appearance inherited from ButtonGroup and wrapper defaults.Uses secondary or tertiary text for neutral buttons. Semantic colors and solid surfaces retain their contrast treatment.
Destination URL. Renders a native anchor when
render is omitted unless nativeButton is explicitly true. Custom renderers retain their own element contract.Where the loading indicator appears.
center hides the content while preserving its layout space; start and end keep children and the opposite icon visible and replace the corresponding icon with the spinner.Whether the rendered root is a native button. Defaults to true for custom renderers. The built-in
href anchor defaults to false; an explicit value takes precedence.ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, ButtonState>
Caller-supplied root element or renderer. Native attributes, handlers, event details, and refs reach the rendered root. Use
nativeButton={false} and role="link" for a custom navigation anchor. Router integration belongs to the caller.Flat key array for simultaneous keys, or nested key arrays for an ordered sequence. Displayed on non-mobile screens.
Button height:
sm (24px) or md (32px). The link variant uses its content height at either size.Style applied to the element, or a function that
returns a style object based on the component’s state.