TanStack Router Installation
Install and configure your UI components for TanStack Router projects.
Create project
Start by creating a new TanStack Router project:
pnpm dlx create-tsrouter-app@latest my-app --template file-router --tailwind --add-ons shadcn
Add Components
You can now start adding components to your project. For example, to add the Button component:
pnpm dlx shadcn@canary add button
The command above will add the Buttoncomponent to your project. You can then import and use it like this:
1import { createFileRoute } from "@tanstack/react-router"23import { Button } from "@/components/ui/button"45export const Route = createFileRoute("/")({6 component: App,7})89function App() {10 return (11 <div>12 <Button>Click me</Button>13 </div>14 )15}
For more details, see the documentation for each component.