Render top-level routes beneath shared branding or navigation.
Root application shell
TanStack · Component
TanStack Router's Outlet renders the next matching child route inside a parent route component. It takes no props and renders null when no child route matches.
Outlet is a parameterless component for nested TanStack Router layouts. When rendered inside a route component, it inserts the next matching child route at that position; with no matching child, it renders nothing.
<Outlet />The matched child route's component, errorComponent, pendingComponent, or notFoundComponent; otherwise null.
import { Outlet, createRootRoute } from '@tanstack/react-router'
export const Route = createRootRoute({
component: RootComponent,
})
function RootComponent() {
return (
<main>
<h1>My App</h1>
<Outlet />
</main>
)
}Renders the root layout and places the currently matched child route where Outlet appears.
Root application shell
Nested layouts
Authenticated sections
Conditional route states
Outlet renders the next potentially matching child route inside a parent route's component tree. It accepts no props, and it renders null when no child route matches.
Follow-up: What happens if a route has no component? TanStack Router renders an Outlet automatically for that route.
Place Outlet anywhere in the parent route component tree where the child route should appear. The surrounding elements remain part of the parent layout while the matched child is inserted at that location.
Follow-up: How would you create a shared authenticated layout? Use a layout or pathless layout route, render the shared UI around Outlet, and perform the authentication check in beforeLoad.
The component renders the matched child route's component, error component, pending component, or not-found component as appropriate. It has no configurable props.
Follow-up: What is the fallback when no child route matches? Outlet returns null, so any fallback UI must be supplied by the surrounding route component.
createRootRoutecreateFileRouteRouteComponentdefaultComponentLayout RoutePathless Layout Route