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 10 of 11 · Make it interactive

Forms & actions

A server action handles the form POST, validates it, and returns a result — no API to write.

To mutate data, export an action alongside the component. On a POST, bext runs the action server-side before re-rendering the page; whatever it returns arrives as the actionData prop.

src/app/products/new/page.tsx
export async function action({ request }) {
  const form = await request.formData();
  const name = String(form.get("name") ?? "").trim();
  if (!name) return { error: "Name is required." };
  return { ok: true, name };
}

The form is a plain <form method=\"post\"> — it works even with JavaScript off. Submit it in the preview to watch the action run and the page re-render.

WARNING
Always validate on the server inside the action — never trust client input. See server actions.
Files
src
app
products
new
src/app/products/new/page.tsxread-only
localhost:3000