Skip to content

Button

Create a button with icon or link capabilities. The button can be used to trigger an action or to navigate to a new page. The button can be customized with a color, size, and icon.

Usage

Use the default slot to set the text of the Button.

Primary
Solid
md
Button
button

Variants

The button comes in five different variants.

vue

Modes

Each variant of the button comes with six different modes.

vue

Disabled

The button can be disabled.

vue

Sizes

The button comes in four different sizes.

vue

Icons

The button automatically detects nested icons and sizes them correctly. Make sure to nest text in a <span>, when including both text and icon.

vue

In addition to the default icon size, there is also an option for an icon-only button with a slightly larger icon.

vue

Width

The button can be set to fill its parent container.

vue

It can also simply be given an arbitrary width.

vue

When using an icon-only button, the button can optionally be squared.

vue

as and asChild

Under the hood the Button is using @maas/vue-primitive and accepts both as and asChild props. This means the Button can pass all its attributes to a child component or be rendered with a different HTML tag.