RouterPRISM routing
PRISM routing

This tutorial uses PRISM file-based routing: every folder under src/app/ becomes a URL, with nested layouts and server-side loaders.

Read the routing docs →
UIbext/ui
bext/ui

Components come from bext/ui — a faithful shadcn/ui port for bext and PRISM, styled through route_css tokens.

Explore bext/ui →
FREN
Step 6 of 11 · Build the layout

A dynamic header

Derive the header title from the active route so it's never out of sync.

A header that always says "Dashboard" gets stale fast. Since the layout already knows the active nav item, reuse it for the header title — one source of truth.

src/app/layout.tsx
const title = NAV.find((n) => active(path, n.href))?.label ?? "Dashboard";

<header className="hd">
  <h1>{title}</h1>
</header>

Navigate around the preview — the header title tracks the route. For SEO, set the document title too with generateMetadata on each page:

src/app/products/page.tsx
export function generateMetadata() {
  return { title: "Products — Acme Admin" };
}
TIP
Need page-specific header buttons (like "+ New product")? Render them from the page itself — we'll add one to the products table next.
Files
src
app
src/app/layout.tsxread-only
localhost:3000