--- title: Quick Start --- If you're feeling impatient and prefer to skip all of our wonderful documentation, here is the bare minimum to get going with TanStack Router using both file-based route generation and code-based route configuration: ## Using File-Based Route Generation File based route generation (through Vite, and other supported bundlers) is the recommended way to use TanStack Router as it provides the best experience, performance, and ergonomics for the least amount of effort. ### Scaffolding Your First TanStack Router Project ```sh npm create @tanstack/router@latest # or pnpm create @tanstack/router # or yarn create @tanstack/router # or bun create @tanstack/router # or deno init --npm @tanstack/router ``` Follow the prompts to setup the project. ### Manual Setup #### Install TanStack Router, Vite Plugin, and the Router Devtools ```sh npm install @tanstack/react-router npm install -D @tanstack/router-plugin @tanstack/router-devtools # or pnpm add @tanstack/react-router pnpm add -D @tanstack/router-plugin @tanstack/router-devtools # or yarn add @tanstack/react-router yarn add -D @tanstack/router-plugin @tanstack/router-devtools # or bun add @tanstack/react-router bun add -D @tanstack/router-plugin @tanstack/router-devtools # or deno add npm:@tanstack/react-router npm:@tanstack/router-plugin npm:@tanstack/router-devtools ``` #### Configure the Vite Plugin ```tsx // vite.config.ts import { defineConfig } from 'vite' import viteReact from '@vitejs/plugin-react' import { TanStackRouterVite } from '@tanstack/router-plugin/vite' // https://vitejs.dev/config/ export default defineConfig({ plugins: [ TanStackRouterVite(), viteReact(), // ..., ], }) ``` > [!TIP] > If you are not using Vite, or any supported bundler, you can check out the [File-Based Routing](./guide/file-based-routing.md) guide for more info. Create the following files: - `src/routes/__root.tsx` - `src/routes/index.lazy.tsx` - `src/routes/about.lazy.tsx` - `src/main.tsx` All routes/\*.tsx files should export an object named **Route**, created using createRootRoute or createLazyFileRoute. > 🧠Route files with the `.lazy.tsx` extension are lazy loaded via separate bundles to keep the main bundle size as lean as possible. #### `src/routes/__root.tsx` ```tsx import { createRootRoute, Link, Outlet } from '@tanstack/react-router' import { TanStackRouterDevtools } from '@tanstack/router-devtools' export const Route = createRootRoute({ component: () => ( <>