Skip to content

Button

Polymorphic button component that renders as <button>, <a>, or <router-link>. Supports multiple variants, sizes, icons, and loading states.

Import

typescript
import { Button } from "vuiii";

Basic Usage

vue
import { Button } from 'vuiii'

<Button label="Click me" />
<Button variant="primary" label="Submit" />
<Button variant="danger" label="Delete" />

Props

PropTypeDefaultDescription
labelstring-Button text content
variant'primary' | 'secondary' | 'danger'-Visual style variant
size'small' | 'normal' | 'large''normal'Button size
prefixIconstring-Icon name to show before label
suffixIconstring-Icon name to show after label
loadingbooleanfalseShows spinner and disables button
disabledbooleanfalseDisables the button
outlinedbooleanfalseOutlined style (requires variant)
blockbooleanfalseFull width button
pillbooleanfalseRounded pill shape
type'button' | 'submit' | 'reset''button'Native button type
toRouteLocationRaw-Vue Router link (renders as router-link)
hrefstring-External URL (renders as anchor)

Slots

SlotDescription
defaultButton label content (alternative to label prop)
prefixCustom prefix content (replaces prefixIcon)
suffixCustom suffix content (replaces suffixIcon)

More Examples

With Icons

vue
<Button prefixIcon="plus" label="Add Item" />
<Button label="Download" suffixIcon="arrow-down" />
<Button prefixIcon="save" suffixIcon="chevron-down" label="Save" />

Different Sizes

vue
<Button size="small" label="Small" />
<Button size="normal" label="Normal" />
<Button size="large" label="Large" />
Go HomeAbout
vue
<Button :to="{ name: 'home' }" label="Go Home" />
<Button :to="'/about'" label="About" variant="secondary" />

Storybook

For interactive examples with all variants, see Button in Storybook.

Released under the MIT License.