Skip to content

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.

NameTypeDefaultDescription
labelStringnullText of the MButton.
iconStringnullName of the icon.
iconPosition"left" | "right"leftPosition of the icon.
variant"filled" | "text" | "outlined"filledDefines the importance of the MButton.
roundedbooleanfalseAdd a circular border radius to the MButton.
severity"primary" | "secondary" | "success" | "info" | "warning" | "help" | "danger"primaryDefines the type of the MButton.
loadingbooleanfalseWhether the MButton is in loading state.
loadingIconStringnullIcon to display in loading state.
raisedbooleanfalseAdd a shadow to indicate elevation.
size"sm" | "md" | "lg"mdDefines the size of the MButton.

Slots

Defines valid slots in MButton component.

NameParametersReturnTypeDescription
defaultVNode<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.

NameTypeDefaultDescription
disabledbooleanfalseCurrent disabled state of MButton.
propagatebooleanfalseWhether MButton click event propagate to parent.
type"button" | "submit" | "reset"buttonDefines the type of the MButton.