...

TanStack Router

Fully typesafe Router for React (and friends) w/ built-in caching, 1st class search-param APIs, client-side cache integration and isomorphic rendering.
github-icon
GitHub
10.8kstar-icon
Created 7 years ago, last commit 8 hours ago
559 contributors
4.77k commits
Stars added on GitHub, month by month
8
9
10
11
12
1
2
3
4
5
6
7
2024
2025
Stars added on GitHub, per day, on average
Yesterday
+6star-icon
Last week
+7.6
star-icon /day
Last month
+8.3
star-icon /day
Last 12 months
+8.9
star-icon /day
npmPackage on NPM
Monthly downloads on NPM
8
9
10
11
12
1
2
3
4
5
6
7
2024
2025
README

TanStack Router Header

🤖 Type-safe router w/ built-in caching & URL state management for React!

#TanStack semantic-release Join the discussion on Github Best of JS

Enjoy this library? Try the entire TanStack! TanStack Query, TanStack Table, TanStack Form, TanStack Virtual, TanStack Pacer, TanStack Store, TanStack Ranger, TanStack DB, TanStack Config

Visit tanstack.com/router for docs, guides, API and more!

Partners









Quick Features

  • 100% TypeSafe
    • Route Defs
    • Navigation
    • Relative Navigation
    • Search Params
    • Path Params
    • Loaders
  • 1st Class Search Params
    • Schemas + Validation
    • Parsing + Serialization
    • Immutable
    • Structural Sharing
    • Pre/Post Processing
  • Built-in Caching
    • Stale-While-Revalidate
    • Max-Age
    • Auto Garbage Collection
    • Invalidation
  • Prefetching
  • Automatic Prefetching
  • Transitions
  • Error Boundaries
  • Code Splitting
  • Layout Routes
  • Easy Integration w/ external caches and storage (eg. React Query, Apollo, SWR, RTKQuery)

Example Usage

To run example React projects with Tanstack Router, see CONTRIBUTING.md