Props
| Name | Type | Default | Description |
|---|---|---|---|
activeClass | string | undefined | - | Class to apply when the link is active. |
append:icon | string | undefined | - | Icon to be added on the right of the text. See example |
ariaCurrentValue | "page" | "step" | "location" | "date" | "time" | "true" | "false" | undefined | 'page' | Value passed to the attribute |
async | boolean | undefined | false | Inertia: runs the visit without blocking — the page stays interactive and several async visits can be in flight at once. |
block | boolean | undefined | false | Displays the component as full width. See example |
cacheFor | string | number | (string | number)[] | undefined | - | Inertia: how long a prefetched response stays fresh before it is
re-fetched. A single duration, or |
cacheTags | string | string[] | undefined | - | Inertia: tags to file this visit's prefetch cache under, so a later request can invalidate the whole tagged group. |
component | string | undefined | - | Inertia: the page component this visit resolves to. Rarely set by hand — the server normally decides it. |
data | object | undefined | - | |
disableAutoLoading | boolean | undefined | false | Disables the automatic loading state that tracks async click handlers (enabled by default). Use only when an async click should intentionally remain interactive without automatic pending state. See example |
disabled | boolean | undefined | false | Disables the component: native |
download | string | boolean | undefined | - | Marks an |
exactActiveClass | string | undefined | - | Class to apply when the link is exact active. |
except | string[] | undefined | - | Inertia: the inverse of |
external | boolean | undefined | false | Forces an |
falseValue | any | false | Value emitted when the toggle is deactivated. See example |
group | boolean | undefined | false | Identifies the button as part of a button group. See example |
headers | object | undefined | - | |
href | string | undefined | - | Returns the hyperlink's URL. Can be set, to change the URL. Use for a destination, not an action. The rendered link keeps browser navigation behaviour. See example |
icon | string | undefined | - | Used when only an icon with no text should be displayed. Slot content becomes the visually hidden accessible name. Do not ship an icon-only button without slot text or an explicit |
instant | boolean | undefined | false | Inertia: navigate optimistically on click and reconcile when the response lands, instead of waiting for the round trip. |
interactiveWhileLoading | boolean | undefined | false | Keeps the button clickable while it is loading. Buttons are disabled while loading by default; this escape hatch exists for toggles that must stay interactive (e.g. the dropdown-button caret). |
loading | boolean | undefined | false | Triggers a loading indicator. A loading button is soft-disabled on its
own ( Bind this when pending state is owned outside the click handler, such as a form or store request. See example |
method | "get" | "post" | "put" | "patch" | "delete" | undefined | - | |
modelValue | any | - | |
onBefore | (() => void) | undefined | - | |
onCancel | (() => void) | undefined | - | |
onCancelToken | ((cancelToken: unknown) => void) | undefined | - | |
onError | ((errors: Record<string, string>) => void) | undefined | - | Lifecycle hook invoked by Inertia when the server responds with
VALIDATION errors — the ordinary 422 path.
This is the only failure callback Inertia's |
onFinish | (() => void) | undefined | - | |
only | string[] | undefined | - | |
onPrefetched | (() => void) | undefined | - | Lifecycle hook invoked by Inertia when a prefetch for this link has completed and is cached. |
onPrefetching | (() => void) | undefined | - | Lifecycle hook invoked by Inertia when a prefetch for this link starts. |
onProgress | ((progress: { percentage: number | undefined; }) => void) | undefined | - | |
onStart | (() => void) | undefined | - | |
onSuccess | (() => void) | undefined | - | |
pageProps | Record<string, unknown> | ((currentProps: Record<string, unknown>, sharedProps: Record<string, unknown>) => Record<string, unknown>) | null | undefined | - | Inertia: props to merge into the next page optimistically, before the
server responds. Either an object or a function of the current props.
Typed platform-agnostically (matching BbButton) so the library's types
never require |
prefetch | string | boolean | string[] | undefined | - | Inertia: fetch and cache this link's page ahead of the click. |
prepend:icon | string | undefined | - | Icon to be added on the left of the text. See example |
preserveScroll | boolean | ((props: Record<string, unknown>) => boolean) | undefined | - | |
preserveState | boolean | ((props: Record<string, unknown>) => boolean) | null | undefined | - | |
preserveUrl | boolean | undefined | false | Inertia: keep the current URL in the address bar even though the page content changes. |
pt | PtMap<BbButtonPtPart, BbButtonPtState> | undefined | - | Passthrough, object form: |
pt:icon | PtValue | undefined | - | |
pt:icon:disabled | PtValue | undefined | - | |
pt:icon:loading | PtValue | undefined | - | |
pt:root | PtValue | undefined | - | |
pt:root:disabled | PtValue | undefined | - | |
pt:root:loading | PtValue | undefined | - | |
pt:spinner | PtValue | undefined | - | |
pt:spinner:disabled | PtValue | undefined | - | |
pt:spinner:loading | PtValue | undefined | - | |
pt:text | PtValue | undefined | - | |
pt:text:disabled | PtValue | undefined | - | |
pt:text:loading | PtValue | undefined | - | |
queryStringArrayFormat | "brackets" | "indices" | undefined | - | |
replace | boolean | undefined | false | Calls |
size | Responsive<Sizes> | undefined | "md" | Sets the size of the button. A single value applies at every breakpoint;
a per-breakpoint map (e.g. |
tag | ButtonTag | undefined | 'button' | Element to render for the plain (non-link, non-router) button: |
target | string | undefined | - | Sets or retrieves the window or frame at which to target content. |
text | string | undefined | - | Text content of the component. |
to | string | wt | bt | undefined | - | Route Location the link should navigate to when clicked on. Use for internal Vue Router or Nuxt navigation instead of calling the router from |
trueValue | any | true | Value emitted when the toggle is activated. See example |
type | "button" | "submit" | "reset" | undefined | - | Gets the classification and default behavior of the button. Defaults to |
variant | ButtonVariantType | undefined | "primary" | Visual variant of the button. Controls colors and surface style while keeping spacing and sizing unchanged. Choose by hierarchy, not colour. Register recurring project variants; use |
viewTransition | boolean | undefined | false | Inertia: run the page swap inside a View Transition, where the browser supports one. |
v-model
Values kept in sync through v-model.
| Name | Type | Description |
|---|---|---|
modelValue | any | See example |
Events
| Name | Type | Description |
|---|---|---|
update:modelValue | (event: "update:modelValue", value: any): void |
Slots
The listed properties are the ones exposed to the slot scope.
| Name | Type | Description |
|---|---|---|
default | object | Primary content rendered inside the button. Falls back to the The visible label, or the accessible name when |
Changes from v2
Props removed or renamed in 3.0. If you are coming from v2, the answer is here.
enabledWhileLoadinginteractiveWhileLoadingfails silentlythemeremovedfails silentlytooltipremovedfails silentlytooltipPlacementremovedfails silentlytooltipTimeoutremovedfails silently