Button<mds-button>Generato da @maggioli-design-system/magma@2.3.0dist/documentation.json. Incapsulamento: shadow.
Questa pagina è generata dai pacchetti Magma, documentati solo in inglese.
I componenti Magma sono web component: elementi personalizzati che scrivi come i tag HTML, con qualsiasi framework o senza. Le proprietà li configurano, gli eventi dicono cosa è successo, i metodi sono funzioni da chiamare sull'elemento e gli slot accolgono il contenuto che metti al suo interno.
Proprietà
Imposta una proprietà come attributo HTML nel markup, oppure come proprietà da JavaScript. La colonna Attributo dà il nome dell'attributo, un trattino quando coincide con la proprietà; le proprietà senza attributo, come array e funzioni, si impostano solo da JavaScript. Per spegnere un attributo booleano, rimuovilo: non scrivere mai disabled="false".active
-
booleanSpecifies if the button is active or not
animation
-
none | yugop | undefinednoneSpecifies if the text is animated when it is rendered
autoFocusauto-focusbooleanSpecifies if the component is focused when is loaded on the viewport
await
-
boolean | undefinedSpecifies if the button is awaiting for a response
disabled
-
boolean | undefinedSpecifies if the component is disabled or not
href
-
string | undefinedTurns the button into a link to this URL: a real anchor in its shadow root, so the browser
gives it what it gives every link (new tab on a modifier or middle click, the context menu,
drag). A client-side router takes the plain clicks over once registered with
NavigationService.setHandler() (from @maggioli-design-system/magma/services); without
one, a click listener on the host can still cancel the navigation with preventDefault().
icon
-
string | undefinedThe icon displayed in the button
iconPositionicon-positionleft | right | undefinedleftSpecifies the horizontal position of the icon displayed in the button
label
-
string | undefinedThe label of the button
name
-
string | undefinedThe name sent with value to the form the button submits, as a native submit button
does: buttons that submit the same form tell the receiver which one was chosen
size
-
lg | md | sm | xlmdSpecifies the size for the button
target
-
blank | selfselfSpecifies the target of the URL, if self or blank
tone
-
box | outline | strong | text | weak | undefinedstrongSpecifies the tone variant for the button
truncate
-
all | none | word | undefinedwordSpecifies if the text shoud be truncated or should behave as a normal text
type
-
a | button | reset | submit | undefinedsubmitThe type of the button element
value
-
string | undefinedThe value sent under name to the form the button submits
variant
-
ai | apple | dark | error | google | info | light | primary | secondary | success | warning | undefinedprimarySpecifies the color variant for the button
Slot
Gli slot accolgono il contenuto che scrivi tra i tag del componente. Lo slot predefinito, quello senza nome, accetta solo testo, salvo dove la sua descrizione dice altrimenti. Se il componente ha anche la proprietà label, preferisci la proprietà. Il contenuto di uno slot con nome va su un figlio diretto, con il nome dello slot nell'attributo slot, ad esempio slot="notification".(predefinito)Add text string to this slot, avoid to add HTML elements or components here.
Nessun nome slot
notificationAdd HTML elements or components, it is recommended to use mds-notification element.