Vue Router

The official client-side router for Vue.js, powering nested routes, navigation guards, and single-page app navigation.

Framework
npm
v5.4.0
4,700 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
95 /100 Excellent
Development Activity 96
Maintenance 100
Community 84
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
88 /100 Excellent
Architecture 90
Code Quality 88
Innovation 87
Learning Curve 85

Vue Router is the official routing library for Vue.js applications, maintained under the vuejs GitHub organization by Eduardo San Martin Morote. It maps URL paths to component trees, supporting nested routes, dynamic path segments, and named views, and it integrates directly with the Vue reactivity system via composables like useRouter and useRoute.

Beyond basic path matching, Vue Router provides a full navigation lifecycle: global, per-route, and in-component navigation guards; async route components with data-fetching hooks; scroll behavior control; and history modes (HTML5, hash, and memory for SSR/testing). Version 5 adds first-class Vite plugin integration, a file-based routing unplugin, and a RouterView/RouterLink-driven typed-routes system that generates route name and param types automatically.

What You Get

  • A createRouter() factory supporting HTML5 history, hash, and in-memory history modes
  • Nested and dynamic route matching with named routes, params, and query/hash handling
  • Navigation guards at the global, per-route, and in-component level, including async guards
  • RouterView and RouterLink components plus useRouter/useRoute composables for the Composition API
  • A Vite plugin and file-based routing unplugin that generates typed routes from your file structure
  • Scroll behavior customization and lazy-loaded route components for code-splitting

Common Use Cases

  • Building multi-page navigation for a Vue single-page application
  • Gating routes behind authentication with navigation guards
  • Code-splitting an app by lazily loading route-level components
  • Generating typed, autocompletable route names and params via file-based routing
  • Restoring or customizing scroll position across navigations

Under The Hood

Architecture - The library is organized around a small set of composable modules under packages/router/src: matcher/ builds and ranks a path-matching tree from route records (pathTokenizer.ts, pathParserRanker.ts), history/ abstracts over HTML5, hash, and memory navigation backends behind a common interface (history/common.ts), and router.ts ties these together in createRouter(), orchestrating resolution, guard execution (navigationGuards.ts), and Vue app integration via injectionSymbols.ts. RouterView.ts and RouterLink.ts are the rendering surface, consuming reactive route state exposed through shallowRef/shallowReactive so navigation updates propagate through Vue’s reactivity system without deep-cloning route objects on every change.

Tech Stack - Written in TypeScript and built with tsdown (a Rollup-based bundler), targeting ESM with CJS interop (index.cjs, dist/vue-router.js) and a UMD/global bundle for CDN use. Peer dependencies are vue ^3.5.34 || ^4.0.0 and, for the newer Vite/file-based routing features, vite ^7.3.0 || ^8.0.0 and @vue/compiler-sfc, all marked optional so consumers who only need the core router avoid pulling in Vite. The unplugin layer for file-based routing depends on unplugin, tinyglobby, and mlly for cross-bundler file scanning and module resolution.

Code Quality - The __tests__/ directory contains 47 test files covering the matcher, history backends, and navigation guards in isolation, run via Vitest (test:unit) alongside a separate test:types pass using tsgo/vue-tsc for type-level regression testing, plus Playwright-driven e2e/ scenarios (scroll behavior, keep-alive, suspense, multi-app). Source files are narrowly scoped by responsibility (one concern per file: encoding.ts, query.ts, scrollBehavior.ts), and public types are documented with TSDoc comments consumed by the published API docs.

API Design - The public surface favors composables (useRouter, useRoute) over injected globals, mirroring Vue 3’s Composition API conventions, and getting started requires only passing a routes array to createRouter() and calling app.use(router) — no boilerplate provider wiring beyond that. Multiple entry points (vue-router, vue-router/auto, vue-router/vite, vue-router/unplugin) let consumers opt into typed/file-based routing incrementally rather than committing to it upfront, and TypeScript augmentation via TypesConfig lets advanced users swap the public Router type without forking the library.

Used by 50 apps in this directory

Java
56%
Apache 2.0

Kestra

Automation · Data Engineering · Devops

29,967

Event-driven orchestration platform for data, AI, and infrastructure workflows — define everything in YAML, run anywhere at scale.

View details
94
Repo Health
81
Technical
69
Dependency
Built with
Java 56%
TypeScript 29%
Vue 14%
Updated 1 weeks ago
Go
51%
AGPL 3.0

listmonk

Blogging · Marketing

23,944

High-performance, self-hosted newsletter and mailing list manager packaged as a single binary with built-in analytics, transactional messaging, and multi-channel delivery.

View details
90
Repo Health
74
Technical
64
Dependency
Built with
Go 51%
JavaScript 22%
HTML 20%
Updated 6 days ago
TypeScript
72%
Apache 2.0

Litlyx

Analytics

1,746

Cookie-free, AI-powered web analytics you can self-host in 30 seconds with Docker.

View details
45
Repo Health
51
Technical
72
Dependency
Built with
TypeScript 72%
Vue 26%
Updated 11 months ago
TypeScript
71%
Other

LogChimp

Marketing · Product Management

1,132

Collect customer feedback, prioritize features with upvotes, and build transparent product roadmaps — fully self-hosted and open source.

View details
83
Repo Health
77
Technical
72
Dependency
Built with
TypeScript 71%
Vue 27%
Updated 1 weeks ago
Rust
59%
Apache 2.0

magika

Developer Tools · Security

18,740

AI-powered file type detection that identifies 200+ content types with ~99% accuracy in milliseconds using a compact deep learning model.

View details
85
Repo Health
85
Technical
74
Dependency
Built with
Rust 59%
YARA 12%
Python 10%
Updated 1 weeks ago
TypeScript
81%
AGPL 3.0

massCode

Code Editors · Developer Tools · Productivity

7,085

A free, local-first developer workspace unifying snippets, notes, HTTP requests, calculations, drawings, and dev tools in one desktop app.

View details
85
Repo Health
87
Technical
62
Dependency
Built with
TypeScript 81%
Vue 17%
Updated 2 weeks ago
Python
45%
GPL 3.0

MaxKB

AI Development · Knowledge Management

23,022

Build enterprise-grade AI agents with RAG, workflows & multi-modal support

View details
92
Repo Health
68
Technical
66
Dependency
Built with
Python 45%
Vue 37%
TypeScript 17%
Updated 1 weeks ago
Python
67%
AGPL 3.0

MiroFish

AI Agents · AI Development

81,570

A universal swarm intelligence engine that spawns thousands of autonomous AI agents to simulate and predict how real-world events unfold across social, financial, and political domains.

View details
65
Repo Health
65
Technical
79
Dependency
Built with
Python 67%
Vue 33%
Updated 2 weeks ago
TypeScript
92%
Other

n8n

Automation · No Code Platforms

208,437

Code when you need it, UI when you don't — the workflow automation platform built for technical teams who refuse to choose.

View details
95
Repo Health
87
Technical
62
Dependency
Built with
TypeScript 92%
Updated 1 weeks ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers