Verified against Claude Code · 2026-07-24
Build a multi-panel dashboard with parallel routes instead of client-side tab state
Structures independent dashboard panels as parallel route slots that each stream, load, and error on their own, instead of one component juggling tab state and a single spinner.
The prompt
Ready to copy — highlighted parts are example details you can swap.
<context> Dashboard panels needed, and roughly what each one shows: revenue chart (last 30 days), recent activity feed, team member list Independent navigation requirements — can panels change without a full page reload, do they need their own URLs: The activity feed panel should support its own filter state in the URL; the others don't need deep-linking </context> <task> Structure this dashboard using parallel routes (the @folder convention) inside a shared layout.tsx, with one slot per independent panel, instead of a single page component that fetches everything and manages which panel is "active" with client-side state. </task> <requirements> - Create one @slotName folder per panel under the layout, each with its own page.tsx that fetches only that panel's data. - Give each slot its own loading.tsx so a slow panel shows its own skeleton and streams in independently — a slow analytics query should never block the activity feed panel from rendering. - Give each slot its own error.tsx so one panel's fetch failure shows an inline error in that panel only, not a full-page crash. - Add a default.tsx in each slot that returns null (or a sensible fallback) for the case where a hard navigation/refresh doesn't match that slot's most specific route — without it, Next.js 404s the whole layout on refresh for any slot that doesn't have a matching segment. - The layout.tsx receives all slots as props (children plus each named slot) and arranges them in the grid/panel layout — it does not itself fetch data. </requirements> <output_format> The folder structure (as a tree), the layout.tsx showing how slots are composed, and one paragraph confirming what happens on a hard refresh when only one slot's URL segment is present. </output_format>
Customize the highlighted detailsoptional — the prompt above already works
Why this works
Parallel routes solve a specific problem generic React tab-state doesn't: each @slot is its own independent route segment with its own data fetching, loading.tsx, and error.tsx, which means a slow panel streams in on its own schedule and a failed panel shows its own error boundary — none of that requires the layout component to coordinate loading/error state by hand. The default.tsx requirement is the part most first attempts miss and the part that actually breaks in production: without it, refreshing the browser on a URL that only specifies one slot's segment causes Next.js to 404 the entire layout, because the other slots have no matching route for that navigation and no fallback to render instead.
What you get back
app/dashboard/layout.tsx (with @revenue, @activity, @team slots) receives { children, revenue, activity, team } as props and arranges them in a CSS grid. Refreshing on /dashboard/activity/filtered renders @activity's matching segment, while @revenue and @team fall back to their default.tsx (rendering their last-known default view) instead of 404ing the page.
Verified against
Claude Code Sonnet 4.6 · 2026-07-24
v0 by Vercel 2026.6 · 2026-07-26
Changelog
- 2026-07-24 — Initial version, tested against Claude Code on a Next.js 16 App Router dashboard with three parallel slots.
Need this built into your business?
If a prompt isn't enough — custom software, built and maintained for you — that's Scult's day job.
EXPLORE CUSTOM SOFTWARE

