Type-safe router
TanStackRouter
The route tree is the application contract.
Router turns your routes into typed APIs for navigation, URL state, loaders, pending states, and code splitting. Keep the app client-first, then bring Start in when the same route tree needs a server.
00.0 MillionTotal Downloads21,033,205Weekly Downloads14,702GitHub Stars
The fastest-growing router in the JavaScript ecosystem.
Typed route map
paths, params, links, navigate
URL state APIs
search schemas, parse, serialize
Data before render
loaders, cache, prefetch, pending UI
Application builder
Start with a Router app, then add only what the product asks for.
Describe the app shape and the builder will bias toward Router: typed routes, search state, loaders, and a clean client-side foundation. When the brief needs full-stack work, it can point you toward Start instead of pretending every app is the same.
Route contract
The file, the URL, and the component agree.
Router is not just a path matcher. It is a generated contract that ties route params, search schemas, loader data, context, links, and navigation to the same route tree.
links
Navigation knows the route tree.
Link, redirect, and navigate calls autocomplete against generated paths, params, and search contracts instead of stringly-typed guesses.
search
Search params behave like state.
Parse, validate, inherit, update, and share URL state with the same confidence you expect from a state manager.
loaders
Data work starts at the route.
Route loaders run in parallel, preload on intent, cache results, and hand typed data to the component before render.
boundaries
Every route owns its lifecycle.
Pending UI, errors, not-found states, code splitting, and context can live where the product route actually changes.
/docs?page=2&q=router&sort=stars&tags=react%2Csolid
validated
validateSearch: z.object({
q: z.string().optional(),
page: z.number().catch(1),
sort: z.enum(['stars', 'recent']),
tags: z.array(z.string()).catch([])
})
URL state
Search params without the URLSearchParams ceremony.
Filters, tabs, pagination, sort order, and shareable UI state can live in the URL without becoming string parsing chores. Router gives search params schemas, validation, inheritance, structural sharing, and type-safe writes.
Loaders and preload
Navigation can start before the click lands.
Route loaders hoist async work out of components, run in parallel, cache results, and preload when the user shows intent. The route owns the data boundary, so pending and error UI stay close to the product surface.
1
match
The next route is known before the component renders.
2
preload
Hover, viewport, or intent can start route data early.
3
cache
Loaders reuse fresh results and avoid waterfalls by default.
4
render
Components receive typed loader data and pending state.
Open source ecosystem
Router is the foundation many TanStack apps build on.
Router is built in public by the same community shaping Start, Query, and the rest of the stack. Maintainers, examples, partners, and sponsors stay part of the product story.
Maintainers
Partners
Router You?
We're looking for
TanStack Router
Partners to join our mission! Partner with us to push the boundaries of
TanStack Router
and build amazing things together.
Only one thing left to do...