PACKAGE · ROUTING

wouter

Minimalist-friendly ~1.5KB router for React

WEEKLY DOWNLOADS 1.0M
STARS 7.8K
FORKS 184
OPEN ISSUES 29
GZIP SIZE 5.6 kB
UNPACKED SIZE 75.3 kB
DEPENDENCIES 4
LAST UPDATED 5mo ago
DOWNLOAD TRENDS

wouter downloads — last 12 months

Download trends for wouter1 download series from Jun 2025 to May 2026. Use left and right arrow keys to inspect monthly values.01.8M3.5M5.3M7.0MJun 2025SepDecMarMay 2026
wouter
ABOUT WOUTER

Wouter is a minimalist and exceptionally small routing library for React applications, designed to solve the common problem of client-side navigation without bloating your bundle size. It provides a straightforward API for declarative routing, allowing developers to map URL paths to React components efficiently. Its primary goal is to offer a performant and easy-to-understand routing solution for developers who prioritize lean codebases.

Wouter's core philosophy centers on simplicity and ease of use, making it an ideal choice for projects that may not require the extensive feature set of larger routing libraries. It targets developers seeking a low-overhead alternative that integrates seamlessly with React's component model and hook-based patterns. The library achieves its small footprint by excluding certain advanced routing features, focusing instead on essential navigation functionalities.

The library exposes hooks such as `useLocation`, `useRoute`, and `useRouter` to manage and interact with the routing state and history. Components like `<Link>` and `<Route>` are provided for declarative path matching and navigation, mirroring common patterns in other routing solutions but with a reduced API surface. This hook-centric approach aligns well with modern React development practices.

Wouter integrates smoothly into standard React projects, including those using Preact due to its compatibility. It is designed to be framework-agnostic beyond React, making it a versatile choice for various frontend architectures. Its zero-dependency nature ensures no extra build or runtime complexities are introduced into your project's dependency graph.

With a gzipped bundle size of only 5.6 kB, Wouter stands out for its remarkable performance and minimal impact on load times. Its small size is a deliberate design choice, contributing to faster initial page loads and a more responsive user experience. The library is actively maintained, with a recent update in May 2026, indicating ongoing development and support.

However, Wouter's minimalist design means it may not be suitable for extremely complex routing scenarios that rely on advanced features like nested routing with programmatic access to every aspect of the route definition or intricate route guards that are built into more comprehensive libraries. Developers needing these specific functionalities might find they need to implement workarounds or consider alternatives.

WHEN TO USE
  • When building small to medium-sized React applications where bundle size is a critical performance factor.
  • For projects that require basic navigation between different views or pages without complex route matching logic.
  • When integrating routing into applications built with Preact, benefiting from its compatibility.
  • For developers who prefer a hook-based API like `useLocation` and `useRouter` for managing navigation state.
  • When you need a router that offers a minimal API surface for common routing tasks using components like `<Link>` and `<Route>`.
  • For projects that benefit from a zero-dependency router to minimize potential conflicts and build times.
WHEN NOT TO USE
  • If your application requires advanced nested routing structures that are deeply integrated and programmatically controlled.
  • When you need built-in route protection or complex authorization logic that some other routing solutions provide out-of-the-box.
  • If you are building a very large-scale application that relies heavily on the extensive tooling and features of more established, feature-rich routing libraries.
  • When you need to leverage dynamic URL segment matching with numerous parameters and complex validation logic that might be cumbersome to implement manually.
  • If your project has existing complex routing configurations that would be difficult to migrate to Wouter's simpler model without significant refactoring.

CORRECTIONS

Spot wrong data here?

A short note helps us fix it.

Anonymous · No account · No email back

COMPARISONS 3
wouter vs @tanstack/react-router ★ 14.6K · 9.5M/wk wouter vs @remix-run/router ★ 56.4K · 12.3M/wk wouter vs react-router ★ 56.4K · 23.8M/wk