src/routes/ at build time, registers the route, and, if you export a config, adds it to the sidebar with a label and icon. There is no route table and 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. Add a widget or a custom field to inject into it. 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
1
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
2
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.3
Open it in the running panel
Start the project, then open the vendor portal.Reviews appears in the sidebar at the position set by
Terminal
rank, and /reviews renders your component.Verify
- The sidebar shows Reviews with the star icon.
- Navigating to
/reviewsrenders the page inside the standard panel layout, with the 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.