Vue Router

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

Framework
npm
v5.2.0
4,668stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
96/100Excellent
Development Activity100
Maintenance100
Community84
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
88/100Excellent
Architecture90
Code Quality88
Innovation87
Learning Curve85

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 49 apps in this directory

Go
72%
GPL 3.0

1Panel

Devops · Hosting Control Panel · Monitoring

36,573

The only open-source VPS control panel with native AI agent runtime — deploy websites, Docker stacks, and local LLMs from one web interface.

View details
91
Repo Health
76
Technical
67
Dependency
Built with
Go72%
Vue28%
Updated today
Other

Akaunting

Invoicing Finance

10,070

Open-source online accounting for small businesses and freelancers — invoices, expenses, and reporting without monthly fees or vendor lock-in.

View details
98
Repo Health
73
Technical
63
Dependency
Updated yesterday
Python
68%
Other

Baserow

No Code Platforms · Databases

5,635

Open-source no-code platform to build databases, apps, automations, and AI agents — self-hosted or cloud, with full data ownership.

View details
89
Repo Health
84
Technical
68
Dependency
Built with
Python68%
JavaScript15%
Vue12%
Updated today
PHP
63%
Other

BillaBear

Ecommerce · Invoicing Finance

754

Self-hostable subscription management and billing platform with Stripe integration, tax automation, configurable workflows, and Twig-based document generation.

View details
47
Repo Health
66
Technical
66
Dependency
Built with
PHP63%
Vue18%
Gherkin13%
Updated 2 months ago
Go
92%
AGPL 3.0

BillionMail

Marketing

15,424

Self-hosted email server and marketing platform that gives you unlimited sending, full deliverability control, and AI-assisted campaigns without monthly fees.

View details
59
Repo Health
74
Technical
73
Dependency
Built with
Go92%
Updated 2 months ago
Ruby
49%
Other

Chatwoot

Customer Support

35,974

Open-source omnichannel customer support platform with AI-powered agents, live chat, and self-hosting — a full Intercom and Zendesk alternative.

View details
95
Repo Health
78
Technical
72
Dependency
Built with
Ruby49%
Vue26%
JavaScript22%
Updated today
TypeScript
45%
Other

Convex Backend

Developer Tools · Databases

12,394

Open-source reactive database that lets developers build live-updating apps with pure TypeScript, strong consistency, and real-time subscriptions—no separate API layer required.

View details
88
Repo Health
82
Technical
70
Dependency
Built with
TypeScript45%
Rust43%
Updated today
Go
62%
Apache 2.0

Coroot

Analytics · Monitoring

7,877

eBPF-powered observability with AI root cause analysis — zero code changes required, full-stack visibility out of the box.

View details
88
Repo Health
80
Technical
65
Dependency
Built with
Go62%
Vue36%
Updated yesterday
PHP
78%
Other

Craft CMS

CMS

3,601

A developer-first PHP CMS with clean-slate content modeling, auto-generated GraphQL API, and a four-tier edition system that scales from solo projects to enterprise deployments.

View details
96
Repo Health
83
Technical
63
Dependency
Built with
PHP78%
JavaScript14%
Updated today

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

Search