Button
Button
A command in eight severities, four variants and three sizes, with icons, a loading state, a badge, and rendering as a link.
WAI-ARIA tested
Import
main.ts
import { Button } from '@vitral/vue';Severities
Filled is the default variant. `secondary` is the quiet button of a toolbar; `primary` is the one that commits.
Outlined
Text
Icons
Icons from anywhere
An imported icon, another library's component, or trusted SVG markup. An icon font's classes work too: `icon="fa-solid fa-user"`, once its stylesheet is on the page.
Sizes and shape
States
Loading disables the button and sets aria-busy.
API
Read from packages/vue/src/components/Button/types.ts, so it says what the component actually accepts.
Props
| Name | Type | Description |
|---|---|---|
| label | string | — |
| icon | IconProp | — |
| iconPos | 'left' | 'right' | 'top' | 'bottom' | — |
| loading | boolean | Shows a spinner, disables the button and marks it busy. |
| loadingIcon | IconProp | — |
| severity | ButtonSeverity | — |
| variant | ButtonVariant | — |
| size | Size | — |
| rounded | boolean | — |
| raised | boolean | — |
| fluid | boolean | — |
| badge | string | number | — |
| disabled | boolean | — |
| type | 'button' | 'submit' | 'reset' | — |
| as | string | Component | Render as another element or component (`'a'`, `RouterLink`), keeping the button's look and behaviour. |
Plus pt, dt and unstyled from BaseProps, see pass-through and unstyled mode.
Slots
| Name | Slot props | Description |
|---|---|---|
| default | — | — |
| icon | — | — |
| loadingicon | — | — |