djankies/claude-configs/implementing-parallel-routes
Claude Code and agent skill by djankies/claude-configs
- community
Checking that the SKILL.md file is still in the repository.
Teach parallel routes and slot patterns in Next.js 16. Use when implementing parallel routes, working with @slot syntax, or encountering missing default.tsx errors.
Install
npx vskill@latest install djankies/claude-configs/implementing-parallel-routesSKILL.md
The same SKILL.md was published earlier as majiayu000/claude-skill-registry/implementing-parallel-routes.
Parallel Routes in Next.js 16
Concept
Parallel routes allow you to simultaneously render multiple pages within the same layout. Each route is defined in a "slot" using the @folder naming convention.
Key characteristics:
- Slots are defined with
@prefix (e.g.,@team,@analytics) - Each slot is passed as a prop to the parent layout
- Slots render independently and can have their own loading/error states
- Navigation within one slot doesn't affect other slots
Basic Structure
The layout receives slots as props:
default.tsx Requirement
CRITICAL: Every slot MUST have a default.tsx file.
When navigating to a route that doesn't match the current slot, Next.js will render the default.tsx fallback. Without it, you'll get a 404 error.
Common error:
Solution: Add default.tsx to every @slot directory.
Navigation Behavior
Parallel routes handle navigation differently than normal routes:
Soft Navigation
When navigating using <Link> or router.push():
- Active slots maintain their current state
- Only the children segment updates
- Slots remain "mounted"
Hard Navigation
When navigating via browser refresh or direct URL entry:
- All slots reset to their default state
default.tsxfiles render for unmatched routes- Each slot independently resolves its route
Example scenario:
- User visits
/→@modalrendersdefault.tsx - User clicks link to
/login→@modalrenderslogin/page.tsx - User refreshes page → URL changes back to
/,@modalrendersdefault.tsx
This is why intercepting routes typically use parallel routes for modals.
Slot Matching
Slots match based on the current URL segment:
At /dashboard/settings:
dashboard/settings/page.tsxrenders inchildrendashboard/@sidebar/settings/page.tsxrenders insidebarslot- If
@sidebar/settings/page.tsxdoesn't exist,@sidebar/default.tsxrenders
Conditional Rendering
You can conditionally render slots:
Common Gotchas
1. Missing default.tsx
Problem: 404 errors when navigating Solution: Add default.tsx to every slot directory
2. Slot not rendering
Problem: Slot prop is undefined in layout Solution: Check slot name matches @folder name (case-sensitive)
3. Unexpected resets
Problem: Slot resets to default on navigation Solution: Ensure target route exists in slot, or use default.tsx intentionally
4. Nested layouts
Problem: Slots not accessible in nested layouts Solution: Slots only pass to immediate parent layout, not descendants
5. Route groups with slots
Problem: Confusion about where to place @slot folders Solution: Place slots at the same level as the layout that consumes them
Practical Example: Modal Pattern
Layout with modal slot:
Modal slot default:
Intercepted route renders in modal:
Direct route renders full page:
When to Use Parallel Routes
Good use cases:
- Dashboard layouts with independent panels
- Modal/drawer patterns with intercepting routes
- Split views with independent navigation
- A/B testing different UI sections
- Conditional sidebar/navigation rendering
Avoid when:
- Simple component composition suffices
- You need parent-child data flow
- Navigation should be tightly coupled
- You're just trying to organize files (use route groups instead)
References
- Next.js Docs: https://nextjs.org/docs/app/building-your-application/routing/parallel-routes
- Intercepting Routes: nextjs-16 skill
ROUTING-intercepting-routes - Route Groups: nextjs-16 skill
ROUTING-route-groups
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingnextjs-16/skills/implementing-parallel-routes/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/djankies/claude-configs/implementing-parallel-routes)