Default
Experimentaldefault.tsx is the fallback for parallel route slots - special file, no URL.
Overview
Place default.tsx inside an @slot folder. When the current URL has no matching child route for that slot, the default is rendered instead. It does not create a URL.
| File | Creates URL? | When rendered |
|---|---|---|
| @analytics/page.tsx | Via parent route | When the slot has a matching child |
| @analytics/default.tsx | No - special file | When the slot has no match for the URL |
| @team/default.tsx | No - special file | Fallback for the team slot |
What is default.tsx?
default.tsx is the soft fallback for a parallel route slot. If navigation leaves a slot without a matching page, the slot shows its default instead of going blank or 404ing the whole page.
- Slot fallback: used when no child route matches inside
@slot - No URL: special file - does not create a route
- Parallel only: meaningful inside
@slotfolders - Not a 404: use
not-found.tsxfor missing routes
default.tsx for Parallel Routes
Parallel slots like @analytics and @team render beside the main page inside the parent layout. When you navigate to a path the slot does not define, that slot shows its default.tsx.
export default function DefaultAnalytics() {
return (
<div className="p-4 text-sm text-neutral-500">
Select an analytics view
</div>
)
}@analytics) do not appear in the URL. Sub-routes under a slot (e.g. views/page) do contribute path segments.Creating a default.tsx
Create default.tsx inside any @slot folder. Export a default component - no special props required.
export default function DefaultTeam() {
return (
<div className="rounded-lg border border-neutral-200 p-6 dark:border-neutral-800">
<h3 className="font-medium">Team</h3>
<p className="mt-1 text-sm text-neutral-500">
Select a team view
</p>
</div>
)
}default.tsx vs page.tsx
| Feature | page.tsx | default.tsx |
|---|---|---|
| Location | Any folder | Inside @slot |
| Creates URL? | Yes | No - special file |
| When rendered | Route matches | Slot has no matching child |
| Use case | Route UI | Soft slot fallback |
/dashboard/settings. If @analytics has no settings child, @analytics/default renders while @team/settings/page (if present) still shows.Complete Example
| Path | URL | Creates URL? |
|---|---|---|
| dashboard/page.tsx | /dashboard | Yes |
| dashboard/@analytics/page.tsx | /dashboard | Via parent (no @ segment) |
| dashboard/@analytics/default.tsx | - | No - special file |
| dashboard/@analytics/views/page.tsx | /dashboard/views | Yes |
| dashboard/@team/settings/page.tsx | /dashboard/settings | Yes |
defaults.tsx so the site does not treat it as the special default.tsx convention. In apps, use default.tsx inside @slot folders.