Nuxt Typed Router screenshot

Nuxt Typed Router

Updated: 21 Mar 2025
378 Stars

Provide autocompletion and typecheck to Nuxt router

Categories

Overview:

This product is a type-safe router designed for use with Nuxt. It provides support for all programmatic navigation utilities in Nuxt, including NuxtLink, useRouter, navigateTo, useRoute, and useLocalePath. It also supports optional parameters and catch-all routes. The router autocompletes route paths, names, and parameters, and throws an error if a route path is invalid. It includes out-of-the-box i18n support and can be extended by configuration and modules.

Features:

  • Type-Safe Router: Provides a type-safe router for Nuxt.
  • Programmatic Navigation Utils: Supports all programmatic navigation utilities in Nuxt, such as NuxtLink, useRouter, navigateTo, useRoute, and useLocalePath.
  • Optional Params and Catch-All Routes: Supports optional parameters and catch-all routes.
  • Autocompletion: Autocompletes routes paths, names, and parameters.
  • Error Handling: Throws an error if a route path is invalid.
  • i18n Support: Includes out-of-the-box i18n support.
  • Extensibility: Supports routes extended by configuration and modules.

Installation:

To install this product, follow these steps:

  1. Clone this repository.
git clone [repository-url]
  1. Install dependencies using pnpm.
pnpm install
  1. Build the project for local tests.
pnpm run test
  1. Start the development playground.
pnpm run prepack && pnpm run dev
  1. Build the project for deployment.
pnpm prepack

Summary:

This product is a type-safe router for Nuxt that provides support for all programmatic navigation utilities, optional parameters, catch-all routes, and autocompletion of routes. It includes out-of-the-box i18n support and can be extended by configuration and modules. The installation process involves cloning the repository, installing dependencies, and building the project for local tests and deployment.