TanStackRouter

Type-safe Routing for React and Solid applications

A powerful React router for client-side and full-stack react applications. Fully type-safe APIs, first-class search-params for managing state in the URL and seamless integration with the existing React ecosystem.

Get Started
0
NPM Downloads
0
Stars on Github
0
Contributors on GitHub
0
Dependents on GitHub

Typesafe & powerful, yet familiarly simple

TanStack Router builds on modern routing patterns made popular by other tools, but has been re-engineered from the ground up to be 100% typesafe without compromising on DX. You can have your cake and eat it too!

Built-in Data Fetching with Caching

Hoist your data fetching and avoid waterfalls with TanStack Router's loader API and get instant navigations with built-in caching and automatic preloading. Need something more custom? Router's API is designed to work with your favorite client-side cache libraries!

Search Param APIs to make your state-manager jealous

Instead of throwing you to the URLSearchParam wolves, TanStack Router outfits you with state-manager-grade search param APIs. With schemas, validation, full type-safety and pre/post manipulation, you can manage your state in the URL and easily sync it to your state-manager of choice.

Loved by Developers

See what teams are saying

"The biggest problem with TanStack Router is that once you've worked with it, you'll have a harder time going back to other routing solutions."

Dominik (TkDodo)
@TkDodo · TanStack

"TanStack Router lives and breathes TypeScript - it's meant for it, they are a perfect match."

Dominik (TkDodo)
@TkDodo · TanStack

"I took a few hours to switch to the file-based generation and was very impressed. Then I used auto codesplitting and was blown away. This is absolutely phenomenal!"

GitHub User
Migration Thread · TanStack Community

"The more I use React + Vite + TanStack Router + TypeScript + TanStack Query, the more I love it."

Catalin Pit
@catalinmpit · Developer Advocate

"I just got Elysia to work with TanStack Router, amazing dx so far.."

An Le
@anlett10 · Developer

"I've been using Tanstack Start for a new project and it's super good. The server functions completely replace the need for TRPC/GraphQL/REST."

Developer
TanStack Community ·

"The biggest problem with TanStack Router is that once you've worked with it, you'll have a harder time going back to other routing solutions."

Dominik (TkDodo)
@TkDodo · TanStack

"TanStack Router lives and breathes TypeScript - it's meant for it, they are a perfect match."

Dominik (TkDodo)
@TkDodo · TanStack

"I took a few hours to switch to the file-based generation and was very impressed. Then I used auto codesplitting and was blown away. This is absolutely phenomenal!"

GitHub User
Migration Thread · TanStack Community

"The more I use React + Vite + TanStack Router + TypeScript + TanStack Query, the more I love it."

Catalin Pit
@catalinmpit · Developer Advocate

"I just got Elysia to work with TanStack Router, amazing dx so far.."

An Le
@anlett10 · Developer

"I've been using Tanstack Start for a new project and it's super good. The server functions completely replace the need for TRPC/GraphQL/REST."

Developer
TanStack Community ·

Feature Rich and Lightweight

100% Typesafe Parallel Route Loaders 1st-class Search Param APIs Nested/Layout Routes Lightweight (12kb) Suspense + Transitions Strict Navigation Auto-completed Paths Search Param Schemas Search Param Validation Search Param Parsing + Serialization Search Param Pre/Post Processing Structural Sharing Automatic Prefetching Asynchronous Elements Pending Elements Error Boundaries

Take it for a spin!

Create a route, pop in a Router, and start slingin' some code!

Wow, you've come a long way!
Only one thing left to do...
Get Started!