MButton API
API defines props, events and others for the MButton component.
MButton
MButton is an extension to standard button element with icons and theming.
Note that
Props of the native html button are also available.
Props
Defines valid properties in MButton component.
| Name | Type | Default | Description |
|---|---|---|---|
label | String | null | Text of the MButton. |
icon | String | null | Name of the icon. |
iconPosition | "left" | "right" | left | Position of the icon. |
variant | "filled" | "text" | "outlined" | filled | Defines the importance of the MButton. |
rounded | boolean | false | Add a circular border radius to the MButton. |
severity | "primary" | "secondary" | "success" | "info" | "warning" | "help" | "danger" | primary | Defines the type of the MButton. |
loading | boolean | false | Whether the MButton is in loading state. |
loadingIcon | String | null | Icon to display in loading state. |
raised | boolean | false | Add a shadow to indicate elevation. |
size | "sm" | "md" | "lg" | md | Defines the size of the MButton. |
Slots
Defines valid slots in MButton component.
| Name | Parameters | ReturnType | Description |
|---|---|---|---|
default | VNode<RendererNode, RendererElement, Object>[] | Custom content can be placed inside MButton via the default slot. Note that when slot is used, label property is not included. |
ButtonContext
Extended properties from the native html button.
| Name | Type | Default | Description |
|---|---|---|---|
disabled | boolean | false | Current disabled state of MButton. |
propagate | boolean | false | Whether MButton click event propagate to parent. |
type | "button" | "submit" | "reset" | button | Defines the type of the MButton. |