Salta ai contenuti
Magma Design System
Button dropdown<mds-button-dropdown>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
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 | undefinedSpecifies the URL target of the button
icon - string | undefinedThe icon displayed in the button
label - stringSpecifies le text label of the component
name - string | undefinedThe name sent with value to the form the primary action submits, as a native submit button does
size - lg | md | sm | xlmdSpecifies the size for the button
target - blank | selfselfSpecifies the target of the URL, if self or blank
tone - strong | 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 | undefinedbuttonThe type of the primary action: with 'submit' or 'reset' it submits or resets the form the component is in, the chevron never does. Unlike mds-button it defaults to 'button'
value - string | undefinedThe value sent under name to the form the primary action submits
variant - ai | dark | error | info | light | primary | secondary | success | warning | undefinedprimarySpecifies the color variant for the button
Eventi
mdsButtonDropdownClickvoidEmits when the primary action is clicked or activated from the keyboard, unless the component is disabled or awaiting. The chevron and the menu items do not emit it, while a native click on the component also comes from the menu items
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à.(predefinito)Add text string, HTML elements or components to this slot.
Nessun nome slot