Props
| Name | Type | Default | Description |
|---|---|---|---|
activeClass | string | undefined | 'router-link-active' | CSS class applied when the component renders as a link and the target of the link is the current route or the url matches partially. Ported for Inertia compatibility. Applied on a path-prefix match — the section link that should stay lit on child pages. The component only attaches the name; the highlight is CSS you write. See example |
ariaCurrentValue | "page" | "step" | "location" | "date" | "time" | "true" | "false" | undefined | 'page' | Value forwarded to the Defaults to |
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 | Makes the component take the full available width (block-level layout).
Adds the Adds |
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 | - | Request payload forwarded to Inertia when navigating via Inertia only: the payload sent with the visit. Ignored outside Inertia. See example |
disabled | boolean | undefined | false | Disables user interaction.
- When rendering as a native button, sets the Adapts to the element: the native attribute on a button, and on a link the |
download | string | boolean | undefined | - | Marks an Always a native anchor navigation, never a router or Inertia visit, which is what makes |
exactActiveClass | string | undefined | 'router-link-exact-active' | CSS class applied when the component renders as a link and the target of the link and the url matches exactly. Ported for Inertia compatibility. Applied only on an exact match, and the one that also carries |
except | string[] | undefined | - | Inertia: the inverse of |
external | boolean | undefined | false | Forces an The escape hatch for a same-origin URL that is not part of the SPA — a legacy route, another application behind the same domain. Same intent as Nuxt's |
headers | object | undefined | - | Additional HTTP headers forwarded to Inertia when navigating via |
href | string | undefined | - | Hyperlink reference used when rendering as an anchor (or as an Inertia link in Inertia-enabled apps). If provided and not disabled, the component renders as an anchor/Inertia link. Renders an anchor — a real document navigation. Under Inertia a same-origin |
instant | boolean | undefined | false | Inertia: navigate optimistically on click and reconcile when the response lands, instead of waiting for the round trip. |
method | "get" | "post" | "put" | "patch" | "delete" | undefined | - | HTTP method used for Inertia navigation when Inertia only, and it turns a link into a non-GET visit. In a Vue Router or plain application it is ignored — an |
onBefore | (() => void) | undefined | - | Lifecycle hook invoked by Inertia right before the request is sent. |
onCancel | (() => void) | undefined | - | Lifecycle hook invoked by Inertia when a request is cancelled. |
onCancelToken | ((cancelToken: unknown) => void) | undefined | - | Receives the Inertia cancel token source when a request is initiated.
Can be used to cancel the request.
Typed platform-agnostically (matching BbButton) so the library's types
never require |
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 The only failure callback an Inertia link accepts, and it fires on validation errors (422) — not on 5xx and not on a request that never arrived. Use an explicit visit or a form when you have to tell those apart. |
onFinish | (() => void) | undefined | - | Lifecycle hook invoked by Inertia after the request has finished (regardless of success or error). |
only | string[] | undefined | - | Limits the properties that are preserved in Inertia partial reloads. |
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 | - | Progress callback invoked by Inertia with the upload/download percentage when available. |
onStart | (() => void) | undefined | - | Lifecycle hook invoked by Inertia when a request starts. |
onSuccess | (() => void) | undefined | - | Lifecycle hook invoked by Inertia when a request succeeds. |
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. |
preserveScroll | boolean | ((props: Record<string, unknown>) => boolean) | undefined | false | Controls whether Inertia should preserve the current scroll position after navigation. Can be a boolean or a predicate receiving the visit props. Inertia only. The usual case is a link inside a long list whose result renders in place — without it the visit lands at the top of the page. See example |
preserveState | boolean | ((props: Record<string, unknown>) => boolean) | null | undefined | false | Controls whether Inertia should preserve the current state after navigation. Can be a boolean or a predicate receiving the visit props. |
preserveUrl | boolean | undefined | false | Inertia: keep the current URL in the address bar even though the page content changes. |
pt | PtMap<"root", "disabled"> | undefined | - | Passthrough, object form: the same keys as the |
pt:root | PtValue | undefined | - | |
pt:root:disabled | PtValue | undefined | - | |
queryStringArrayFormat | "brackets" | "indices" | undefined | 'brackets' | Format to use when serializing array values into the query string for Inertia requests. |
rel | string | undefined | - | Relationship between the current document and the linked resource.
Useful for security when opening new tabs (e.g. Your tokens are preserved; the security ones are added on top whenever a |
replace | boolean | undefined | false | Uses history replacement instead of push navigation.
- With Vue Router ( Swaps the current history entry instead of pushing one, under both Vue Router and Inertia. Right for anything that is a view control rather than a step in the user's journey. See example |
tag | ButtonTag | undefined | 'button' | Element to render for the plain (non-link, non-router) button:
- A last resort for contexts where a |
target | string | undefined | - | Target browsing context for anchor/Inertia links (e.g. Forces a plain anchor even where routing would otherwise apply. Any value other than |
text | string | undefined | - | Fallback text content rendered when no default slot is provided. A string-only fallback for loops that spread a config object. Prefer the default slot: slot content wins when both are present. See example |
to | string | wt | bt | undefined | - | Route location to navigate to. When provided (and not disabled), the component renders as a Vue Router link. The router form, and the only one that stays inside a Vue Router or Nuxt application. It needs a router to resolve against: in a router-free page it renders nothing useful, and |
type | "button" | "submit" | "reset" | undefined | "button" | Native Defaults to |
viewTransition | boolean | undefined | false | Inertia: run the page swap inside a View Transition, where the browser supports one. |
Slots
The listed properties are the ones exposed to the slot scope.
| Name | Type | Description |
|---|---|---|
default | object | Primary content rendered inside the button element. Falls back to the The label. For a rich card overlay, keep it short and visually hidden ( |