Get started with TanStack Router by installing the package in your React project.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/tanstack/router/llms.txt
Use this file to discover all available pages before exploring further.
Requirements
Before installing TanStack Router, ensure you have:- Node.js: Version 20.19 or higher
- React: Version 18.0.0 or higher (React 19 is also supported)
- TypeScript: Version 5.4 or higher (recommended for full type-safety)
Package Installation
Install the core router package using your preferred package manager:Additional Packages
Depending on your needs, you may want to install additional packages:DevTools (Recommended)
The DevTools package provides a visual debugger for inspecting router state during development:File-Based Routing Plugin
For file-based routing, install the appropriate bundler plugin:The
@tanstack/router-plugin package works with Vite, Webpack, esbuild, and Rspack through a universal plugin interface.Validation Adapters
Add type-safe validation for search params and path params:Vite Plugin Configuration (File-Based Routing)
If you’re using file-based routing with Vite, configure the plugin in yourvite.config.ts:
vite.config.ts
TypeScript Configuration
For the best development experience with full type-safety, ensure yourtsconfig.json includes:
tsconfig.json
Verify Installation
Create a simple test to verify the installation:test.tsx
Next Steps
Now that TanStack Router is installed, you can:Follow the Quickstart
Build a working router in minutes
Learn File-Based Routing
Set up automatic route generation
Explore Code-Based Routing
Define routes programmatically
Configure DevTools
Set up the router DevTools
Package Versions
TanStack Router follows semantic versioning. You can check the latest version on:All TanStack Router packages are published together with matching version numbers for compatibility.