Prezentare generală
Utilizați componenta partajatăLightButton pentru o acțiune ușoară. Este compus din
Button cu o suprafață ghost, dimensiune mică, grosime
normală a fontului și fără elevație.
Utilizare
Opțiuni vizuale
Comparați accentuarea standard și subtilă în stările obișnuite de acțiune.Gestionarea stării
LightButton utilizează modelul de stare al Button și nu adaugă nicio stare proprie. Aplicația ta furnizează loading și disabled; emphasis modifică doar aspectul. Consultați exemplul de gestionare a stării pentru Button pentru gestionarea unei acțiuni asincrone. Nu există moduri de selecție controlate și necontrolate.
Accentuare și pictograme
emphasis="standard" utilizează text neutru secundar.
emphasis="subtle" utilizează text neutru terțiar pe suprafețe ghost, outline și soft
. Culorile semantice și suprafețele solide își păstrează tratamentul de contrast.
Suprascrieți variant, color, size sau elevated când este necesar.
ButtonGroup poate seta o dimensiune, o suprafață
și o culoare comune. Aspectul explicit al elementului copil are prioritate față de grup, urmat de
valorile implicite ale componentei. Accentul subtil nu înlocuiește culoarea semantică.
Interacțiune
LightButton acceptă atributele native ale Button, referințe, handlere de evenimente, sloturi pentru pictograme
, stările loading și disabled și compunerea de randare. Valoarea implicită nativă
este type="button". Setați type="submit" pentru trimitere sau utilizați href pentru un link.
Furnizați render pentru a alege o rădăcină personalizată, inclusiv un link de router
controlat de aplicație. Setați nativeButton={false} și role="link" pentru un renderer de navigare.
Butoanele native personalizate mențin nativeButton la true.
Proprietăți
string | ((state: ButtonState) => string | undefined)
CSS class applied to the element, or a function that
returns a class based on the component’s state.
"accent" | "danger" | "inherit" | "neutral" | "success"
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.boolean
Adds a shadow and backdrop blur. Neutral outline buttons also use elevated surface colors.
"standard" | "subtle"
implicit:"standard"
Uses secondary or tertiary text for neutral buttons. Semantic colors and solid surfaces retain their contrast treatment.
ReactNode
Decorative content displayed after the label.
boolean
implicit:"false"
Whether the button should be focusable when disabled.
boolean
Expands the button to fill its container width.
string
Destination URL. Renders a native anchor when
render is omitted unless nativeButton is explicitly true. Custom renderers retain their own element contract.boolean
Shows a loading indicator and disables activation.
"center" | "end" | "start"
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.boolean
implicit:"true"
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.AriaRole
Role of the root element. Use
link for custom navigation renderers.ShortcutDefinition
Flat key array for simultaneous keys, or nested key arrays for an ordered sequence. Displayed on non-mobile screens.
string
Localized text between sequence steps. Defaults to then.
"md" | "sm"
implicit:"sm"
Button height:
sm (24px) or md (32px). The link variant uses its content height at either size.ReactNode
Decorative content displayed before the label.
CSSProperties | ((state: ButtonState) => CSSProperties | undefined)
Style applied to the element, or a function that
returns a style object based on the component’s state.
"ghost" | "link" | "outline" | "soft" | "solid"
implicit:"ghost"
Visual treatment of the button surface.
link uses compact text styling without a filled surface or border; render composition determines native semantics.