src/routes/ at build time, registers the route, and — if you export a config — adds it to the sidebar with a label and icon. No route table, no registration call.
Adding vs changing. This tutorial adds a brand-new page — the right move for new features. To change an existing page, don’t rebuild it: drop a route at the same path and re-compose the built-in page’s slots. The decision guide compares every extension mechanism.
What you’ll build
A/reviews page in the vendor portal with a sidebar entry — from a single file.
Add the page
Create the route file
Drop a
page.tsx under src/routes/ in your vendor app. The file path becomes the URL, and the default export is the page:apps/vendor/src/routes/reviews/page.tsx
Let the SDK wire it up
At build time the SDK registers the
/reviews route, generates the sidebar item from config (label, icon, rank), and hot-reloads the route tree when you add or remove page files. Dynamic segments use brackets — src/routes/reviews/[id]/page.tsx becomes /reviews/:id. The full path-to-route table is in Extending Panels.Verify
- The sidebar shows Reviews with the star icon.
- Navigating to
/reviewsrenders the page inside the standard panel layout (sidebar and topbar intact). - Removing the
configexport keeps the route working but drops the sidebar item. - Deleting the file removes the route entirely.
FAQ
How do I fetch data on my page?
How do I fetch data on my page?
Use the typed API client with TanStack Query — the panels already ship both. For a full loop including a custom backend endpoint, follow Add a custom API route.
Can the page live under /settings?
Can the page live under /settings?
Yes — place the file under a
settings/ route segment and set nested: "/settings" in the config to group its sidebar item under Settings.Does the same work for the admin panel?
Does the same work for the admin panel?
Identically — drop the file in the admin app’s
src/routes/ instead. Both panels use the same SDK and conventions.