API Reference
Entry points and the exports each one carries.
Updated: 2026-07-26
Entry points
The main entry has no side effects, so a bundler keeps only what you import.
- @rigbyhost/karui β jsx, router, and ssr together
- @rigbyhost/karui/jsx β runtime, hooks, mount, hydrate, unmount
- @rigbyhost/karui/router β createRouter, Link, notFound, redirect
- @rigbyhost/karui/router/file-based β createFileRouter and page module types
- @rigbyhost/karui/ssr β defineSite, renderToString, islands, head
- @rigbyhost/karui/ssr/site-server β the Node dev and production server
- @rigbyhost/karui/ssr/prerender β static export
- @rigbyhost/karui/core β runtime detection and render state
- @rigbyhost/karui/legacy β the inherited newHelper-js toolkit
Page module exports
Every export on a page module is optional except the default component.
- default β the route component, receives the route context
- loader(ctx) β data for reads, available as ctx.data
- action(ctx) β handles POST/PUT/PATCH/DELETE, available as ctx.actionData
- meta β document metadata, an object or a function of the context
- staticPaths() β parameter sets to prerender for a dynamic route
- errorBoundary(ctx) β a route-level error boundary
Route context
Loaders, actions, and components all receive the same shape.
- url β the parsed URL
- pathname β the path portion
- searchParams β a URLSearchParams
- params β route parameters, URL-decoded
- state β site state, RenderState or your own extension
- data β the loader result
- actionData β the action result, when one just ran
- request β the incoming request, on server renders
Legacy toolkit
Karui inherited an imperative pre-JSX toolkit from newHelper-js: DOM helpers, draggable windows, hotkeys, a script lazy-loader, a query-string router, a data-trans i18n service, and a string-returning HTTP client.
It still works, but it lives on its own entry because importing it instantiates a helper and registers a popstate listener. New code should prefer the JSX runtime, the router, and fetch.
ts
import { helper, WindowManager, Hotkeys } from '@rigbyhost/karui/legacy';