@warlock.js/web
@warlock.js/web is Warlock’s React page layer. A page is an ordinary Warlock
route that renders a document instead of JSON, so pages share the application’s
route table, middleware, validation, request context, and lifecycle.
Pages render on the server and hydrate in the browser. After hydration,
<Link> provides client navigation while loaders keep request-only work on the
server.
Choose your starting point
Section titled “Choose your starting point”Install only the highest layer you need. Dependencies are resolved for you:
warlock add web # React SSR page layerwarlock add tailwind # Web + Tailwind CSS v4warlock add shadcn # Web + Tailwind + shadcn/ui prerequisitesFor shadcn/ui, Warlock prepares the project; shadcn’s own CLI still adds the components:
npx shadcn@latest add button cardDo not run shadcn init after warlock add shadcn; Warlock has already written
the project-specific aliases, stylesheet, design tokens, and cn helper.
See the complete Tailwind and shadcn/ui setup →
A page in one file
Section titled “A page in one file”Create src/web/about.page.tsx:
import type { PageMetadata } from "@warlock.js/web";
export const metadata: PageMetadata = { title: "About",};
export default function AboutPage() { return ( <main> <h1>About</h1> </main> );}With no route export, that file serves /about. Warlock derives routes from
files beneath src/web/; an explicit literal route can override the path and
name when needed.
Learn Web by task
Section titled “Learn Web by task”Upgrading from v4? Web is an opt-in addition in v5; start with the v5 migration guide.