# TanStack Vue Router TanStack Vue Router πŸ€– Type-safe router w/ built-in caching & URL state management for Vue! #TanStack semantic-release Join the discussion on Github Best of JS ## Visit [tanstack.com/router](https://tanstack.com/router) for docs, guides, API and more! ## File-Based Routing Conventions | Suffix/Pattern | Purpose | | ----------------------------------- | -------------------------------------------------------- | | `.route.ts` | Route configuration (loader, validateSearch, head, etc.) | | `.component.vue` | The component rendered for the route | | `.errorComponent.vue` | Error boundary component for the route | | `.notFoundComponent.vue` | Not found component for the route | | `.lazy.ts` | Lazy-loaded route configuration | | `_layout` prefix | Layout routes that wrap child routes | | `_` suffix (e.g., `posts_.$postId`) | Unnested routes (break out of parent layout) | | `(groupName)` directory | Route groups (organizational, don't affect URL) | | `$param` | Dynamic route parameters | ### Examples from e2e/basic-file-routes/ project ``` src/routes/ β”œβ”€β”€ __root.ts # Root route config β”œβ”€β”€ __root.component.vue # Root layout component β”œβ”€β”€ __root.notFoundComponent.vue # Global not found component β”œβ”€β”€ index.route.ts # "/" route config β”œβ”€β”€ index.component.vue # "/" component β”œβ”€β”€ posts.route.ts # "/posts" route config β”œβ”€β”€ posts.component.vue # "/posts" layout component β”œβ”€β”€ posts.index.component.vue # "/posts" index component β”œβ”€β”€ posts.$postId.route.ts # "/posts/:postId" route config β”œβ”€β”€ posts.$postId.component.vue # "/posts/:postId" component β”œβ”€β”€ posts.$postId.errorComponent.vue # Error boundary for post β”œβ”€β”€ posts_.$postId.edit.route.ts # "/posts/:postId/edit" (unnested) β”œβ”€β”€ (group)/ # Route group (no URL impact) β”‚ β”œβ”€β”€ _layout.route.ts # Layout for group β”‚ β”œβ”€β”€ _layout.component.vue β”‚ └── inside.component.vue # "/inside" └── λŒ€ν•œλ―Όκ΅­.component.vue # Unicode routes supported ```