Actions

Button

The base clickable action element, with size/color/variant options and optional icon/link behavior.

html
<UiButton />

Size

size is the size of the button.

To

to swaps the underlying element for a NuxtLink — an internal path is routed client-side, an absolute URL renders as a plain anchor.

Setting both to and disabled renders a plain <button>, not a NuxtLink — disabled links can't be prevented from navigating any other way.

Target

target is only meaningful alongside to, where the button renders as a real link. Set it to _blank to open in a new tab.

Variant

variant is four levels of emphasis: solid for the primary action on a page, subtle beside it, soft where a full fill would be too loud, and ghost for the quietest actions — a toolbar icon button, say.

Color

color themes the button across every variant. Keep it tied to meaning rather than decoration: error on the button that deletes something, neutral for everything that just navigates.

solid

subtle

soft

ghost

Icon

icon renders before the label — or on its own, which is what a ghost icon button in a toolbar wants.

Omit the default slot (no text) to get a square icon-only button automatically; passing slot content switches it to a padded, non-square layout.

Icon size

iconSize is scaled to the button by default, so it usually needs nothing. Set it explicitly when the icon should carry more weight than the label — or less.

Disabled

disabled disables interaction with the button.


API Reference

Generated from the component's source — props, slots and emits as the component actually declares them.

Props

Prop
Type
Default
Description
"sm" | "md" | "lg"
'md'
The size of the button.
string
Renders the button as a NuxtLink pointing to this route/URL.
string
The target attribute for the link (e.g. '_blank').
"solid" | "subtle" | "soft" | "ghost"
'subtle'
The visual style of the button.
"neutral" | "primary" | "secondary" | "success" | "error" | "warning" | "info" | "pending"
'neutral'
The color theme of the button.
string
Name of the icon displayed inside the button.
number | "xs" | "sm" | "md" | "lg" | "xl"
'sm' on a small button, 'md' otherwise
Size of the icon, passed through to the UiIcon component.
boolean
false
Disables interaction with the button.

Slots

Slot
default

Types

ts
type Variant = "solid" | "subtle" | "soft" | "ghost";
ts
type Color = "neutral" | "primary" | "secondary" | "success" | "error" | "warning" | "info" | "pending";