wouter-vue Documentation

Wouter for Vue 3

wouter-vue is a minimal, high-performance router for Vue 3 (~7.9KB gzipped, 17.5KB uncompressed) that relies on Composition API and provides an intuitive routing experience.

Features

  • ๐Ÿ“ฆ Minimal bundle size (~7.9KB gzipped, 17.5KB uncompressed) - 72% smaller response size vs vue-router
  • โšก Outstanding performance - 72% higher throughput, handles 83% more requests
  • ๐ŸŽฏ Vue 3 Composition API - Fully reactive routing with TypeScript support
  • ๐Ÿ”ง Optional <Router /> - No top-level router required, works out of the box
  • ๐Ÿ“ฆ Minimal dependencies (Vue 3 + path-to-regexp)
  • ๐ŸŽจ Server-Side Rendering (SSR) - Full SSR support with Vite
  • ๐Ÿ—‚๏ธ Nested routing - Flexible route parameters and nested structures
  • ๐Ÿ”— Active links - Scoped slot API for active state styling
  • ๐Ÿ’พ TypeScript - Full type definitions included
  • ๐Ÿ“Š Hierarchical & Reactive Data Passing - Pass data down routing tree with automatic merging

Performance

Based on load testing with Artillery.io (3,300 virtual users, 200 routes, 6-minute duration):

Metricwouter-vuevue-routerAdvantage
Throughput117 req/s68 req/s+72% faster
Total Requests36,30019,800+83% more requests
Latency (mean)0.9 ms0.6 msComparable
Latency (p50)1 ms1 msSame performance

Key Takeaway: wouter-vue processes 72% more requests per second (117 vs 68 req/s) with identical median latency (1ms) compared to vue-router, while handling nearly double the total requests (36,300 vs 19,800) in the same timeframe, making it ideal for high-traffic applications.

Quick Start

Installation

Requirements: Vue 3.5.22 or higher

Next Steps

About

wouter-vue is inspired by the original wouter router for React and Preact. The original wouterโ€™s minimalist philosophy, hook-based architecture, and elegant simplicity resonated strongly, leading to the creation of this Vue 3 adaptation.

This project attempts to bring the same core principles and design philosophy to Vueโ€™s ecosystem:

  • Minimalist approach - Keep it tiny with minimal dependencies
  • Composition API first - Leverage Vueโ€™s reactivity system instead of React hooks
  • Optional Router - No mandatory top-level component
  • Familiar API - Similar components and patterns for easy migration
  • Performance focused - Small bundle size and efficient routing
  • Path-to-RegExp powered - Uses path-to-regexp for robust route matching with full pattern support
  • Hierarchical data passing - Pass reactive data down routing tree with automatic merging

๐Ÿ’ก Built with wouter-vue

This entire documentation site is built entirely with wouter-vue, including:

  • Server-Side Rendering (SSR) and Static Site Generation (SSG)
  • All routing and navigation
  • Dynamic route generation from Markdown files
  • Search functionality
  • Smooth page transitions

See the source code to explore how wouter-vue powers this documentation site.

Built with wouter-vue โ€ข GitHub