Pages Adapters
Framework adaptors for Pages Routing. Each adaptor provides a Vite plugin and client-side runtime.
@void/vue
voidVue(options?)
Imported from "@void/vue/plugin". Returns an array of Vite plugins that handle Vue SFC compilation and SSR or hydration entry generation. It already includes @vitejs/plugin-vue, so you do not need to install or configure that separately.
import { voidVue } from '@void/vue/plugin';
export default defineConfig({
plugins: [voidPlugin(), voidVue()],
});Signature:
function voidVue(options?: VoidVueOptions): Plugin[];Options:
interface VoidVueOptions {
vue?: VuePluginOptions; // passed through to @vitejs/plugin-vue
viewTransitions?: boolean; // enable View Transitions API for navigations
}Vue Runtime
Imported from "@void/vue".
| Export | Description |
|---|---|
Link | Vue component for SPA navigation. Renders <a> for GET, <button> for non-GET methods. Props: href, method, data, prefetch, cacheFor, preserveScroll, preserveState, replace, reloadDocument, viewTransition, onNavigate. |
useRouter() | Returns the Void Router with current route state (url, path, query, params) and navigation methods: visit, refresh, awaitable prefetch, flush, flushAll. |
useParams() | Returns dynamic route params for the page currently being rendered. |
useNavigation() | Returns pending navigation state: { state, location, method }, where state is "idle", "loading", or "submitting" and location is the pending destination. |
useForm(url, defaults, options?) | Typed reactive form helper bound to a page action URL. Returns { data, post, put, patch, delete, pending, errors, error, hasChanges, wasSuccessful, recentlySuccessful, reset, clearErrors, clearError }. |
useIslandForm(defaults) | Form helper for island components where the action URL is inferred from the current island request. Returns the same form state and submit helpers as useForm(). |
action(url, options?) | Awaitable one-shot page action helper. Uses POST by default and accepts { data, method, params }, where method can be "PUT", "PATCH", or "DELETE". Returns an ActionResult. |
useShared() | Returns shared data injected by middleware via c.set("shared", {...}). |
Vue Link GET data is merged into the rendered href query string. Primitive values are serialized with String(value), arrays become repeated keys, null and undefined are omitted, and nested objects throw. prefetch and reloadDocument are GET-only and throw for mutation links.
Vue GET navigation remounts the page so useForm() picks up the destination record's URL and defaults; layouts persist. Mutations and router.refresh() preserve page state by default. Set preserveState explicitly to override the default for navigation within the same record.
@void/react
voidReact(options?)
Imported from "@void/react/plugin". Returns an array of Vite plugins that handle SSR and hydration entry generation. It already includes @vitejs/plugin-react, so you do not need to install or configure that separately.
import { voidReact } from '@void/react/plugin';
export default defineConfig({
plugins: [voidPlugin(), voidReact()],
});Signature:
function voidReact(options?: VoidReactOptions): Plugin[];Options:
interface VoidReactOptions {
react?: ReactPluginOptions; // passed through to @vitejs/plugin-react
viewTransitions?: boolean; // enable View Transitions API for navigations
prefetch?: {
hoverDelay?: number;
cacheFor?: number | string | [string, string];
};
}React Runtime
Imported from "@void/react".
| Export | Description |
|---|---|
Link | React component for SPA navigation. Renders <a> for GET, <button> for non-GET methods. Props: href, method, data, prefetch, cacheFor, preserveScroll, preserveState, replace, reloadDocument, viewTransition, onNavigate. |
useRouter() | Returns the Void Router with current route state (url, path, query, params) and navigation methods: visit, refresh, awaitable prefetch, flush, flushAll. React navigations are scheduled as transitions. |
useParams() | Returns dynamic route params for the page currently being rendered. |
useNavigation() | Returns pending navigation state: { state, location, method }, where state is "idle", "loading", or "submitting" and location is the pending destination. |
useForm(url, defaults, options?) | Form helper hook. Returns { data, setData, post, put, patch, delete, pending, errors, error, hasChanges, wasSuccessful, recentlySuccessful, reset, clearErrors, clearError }. |
useIslandForm(defaults) | Form helper hook for island components where the action URL is inferred from the current island request. Returns the same form state and submit helpers as useForm(). |
action(url, options?) | Awaitable one-shot page action helper. Uses POST by default and accepts { data, method, params }, where method can be "PUT", "PATCH", or "DELETE". Returns an ActionResult. |
useShared() | Returns shared data injected by middleware via c.set("shared", {...}). |
Deferred<T> | React-only prop type for defer() results. It is Promise<T> and is consumed with React use(). |
React Link GET data is merged into the rendered href query string. Primitive values are serialized with String(value), arrays become repeated keys, null and undefined are omitted, and nested objects throw. prefetch and reloadDocument are GET-only and throw for mutation links.
React deferred props returned from defer() are Suspense resources. Read them with React's use() inside a <Suspense> boundary. React Pages requires React 19 and uses streaming SSR for the initial deferred shell. Rejections throw from use(), so use a normal React error boundary for custom deferred error UI. Vue, Svelte, and Solid keep the { loading, value, error } deferred state object. When explicitly annotating props, import Deferred from the framework adapter package (@void/react, @void/vue, @void/svelte, or @void/solid) so the type matches that adapter's client runtime shape.
@void/svelte
voidSvelte(options?)
Imported from "@void/svelte/plugin". Returns an array of Vite plugins that handle SSR and hydration entry generation for Svelte 5. It already includes @sveltejs/vite-plugin-svelte, so you do not need to install or configure that separately.
import { voidSvelte } from '@void/svelte/plugin';
export default defineConfig({
plugins: [voidPlugin(), voidSvelte()],
});Signature:
function voidSvelte(options?: VoidSvelteOptions): Plugin[];Options:
interface VoidSvelteOptions {
svelte?: SveltePluginOptions; // passed through to @sveltejs/vite-plugin-svelte
viewTransitions?: boolean; // enable View Transitions API
prefetch?: {
hoverDelay?: number;
cacheFor?: number | string | [string, string];
};
}Svelte Runtime
Imported from "@void/svelte".
| Export | Description |
|---|---|
Link | Svelte component for SPA navigation. Renders <a> for GET, <button> for non-GET methods. Props: href, method, data, prefetch, cacheFor, preserveScroll, preserveState, replace, reloadDocument, viewTransition, onNavigate. |
useForm(url, defaults, options?) | Form helper using Svelte 5 runes. Returns { data, post, put, patch, delete, pending, errors, error, hasChanges, wasSuccessful, recentlySuccessful, reset, clearErrors, clearError }. |
useIslandForm(defaults) | Form helper for island components where the action URL is inferred from the current island request. Returns the same form state and submit helpers as useForm(). |
action(url, options?) | Awaitable one-shot page action helper. Uses POST by default and accepts { data, method, params }, where method can be "PUT", "PATCH", or "DELETE". Returns an ActionResult. |
useShared() | Returns shared data injected by middleware via c.set("shared", {...}). |
useRouter() | Returns the Void Router with current route state (url, path, query, params) and navigation methods: visit, refresh, awaitable prefetch, flush, flushAll. |
useParams() | Returns dynamic route params for the page currently being rendered. |
useNavigation() | Returns pending navigation state: { state, location, method }, where state is "idle", "loading", or "submitting" and location is the pending destination. |
Svelte Link GET data is merged into the rendered href query string. Primitive values are serialized with String(value), arrays become repeated keys, null and undefined are omitted, and nested objects throw. prefetch and reloadDocument are GET-only and throw for mutation links.
@void/solid
voidSolid(options?)
Imported from "@void/solid/plugin". Returns an array of Vite plugins that handle SSR and hydration entry generation for Solid. It already includes vite-plugin-solid, so you do not need to install or configure that separately.
import { voidSolid } from '@void/solid/plugin';
export default defineConfig({
plugins: [voidPlugin(), voidSolid()],
});Signature:
function voidSolid(options?: VoidSolidOptions): Plugin[];Options:
interface VoidSolidOptions {
solid?: SolidPluginOptions; // passed through to vite-plugin-solid
viewTransitions?: boolean; // enable View Transitions API
prefetch?: {
hoverDelay?: number;
cacheFor?: number | string | [string, string];
};
}Solid Runtime
Imported from "@void/solid".
| Export | Description |
|---|---|
Link | Solid component for SPA navigation. Renders <a> for GET, <button> for non-GET methods. Props: href, method, data, prefetch, cacheFor, preserveScroll, preserveState, replace, reloadDocument, viewTransition, onNavigate. |
useForm(url, defaults, options?) | Form helper using Solid stores. Returns { data, setData, post, put, patch, delete, pending, errors, error, hasChanges, wasSuccessful, recentlySuccessful, reset, clearErrors, clearError }. |
useIslandForm(defaults) | Form helper for island components where the action URL is inferred from the current island request. Returns the same form state and submit helpers as useForm(). |
action(url, options?) | Awaitable one-shot page action helper. Uses POST by default and accepts { data, method, params }, where method can be "PUT", "PATCH", or "DELETE". Returns an ActionResult. |
useShared() | Returns shared data injected by middleware via c.set("shared", {...}). |
useRouter() | Returns the Void Router with current route state (url, path, query, params) and navigation methods: visit, refresh, awaitable prefetch, flush, flushAll. |
useParams() | Returns dynamic route params for the page currently being rendered. |
useNavigation() | Returns pending navigation state: { state, location, method }, where state is "idle", "loading", or "submitting" and location is the pending destination. |
Solid Link GET data is merged into the rendered href query string. Primitive values are serialized with String(value), arrays become repeated keys, null and undefined are omitted, and nested objects throw. prefetch and reloadDocument are GET-only and throw for mutation links.
Markdown Package
The optional @void/md package adds Markdown pages to Pages Routing. Install it alongside a Pages adapter and add voidMarkdown() to your Vite plugins.
import { voidMarkdown } from '@void/md/plugin';
export default defineConfig({
plugins: [voidPlugin(), voidReact(), voidMarkdown()],
});| Import path | Contents |
|---|---|
@void/md/plugin | voidMarkdown(options?), MarkdownOptions, MdPage |
@void/md | useFrontmatter(), FrontmatterContext, setFrontmatter(), MdPage |
@void/md/pages | Generated metadata for Markdown pages, used for navigation, sidebars, and search indexes |
@void/md/theme.css | Full Markdown theme styles |
@void/md/theme-content.css | Content-only Markdown styles for apps that provide their own shell/layout |
See Markdown Pages for setup and framework-specific examples.
Form
Each Pages adapter exports Form. Pass the object returned by useForm() as form; method defaults to post. It renders validation and action errors, preserves controlled input, and respects known quota retry deadlines without submitting automatically. renderError customizes action-error presentation; Svelte uses a snippet. See Actions and Forms.