PACKAGE · ROUTING

wouter

Minimalist-friendly ~1.5KB router for React

WEEKLY DOWNLOADS 2.7M
STARS 7.9K
FORKS 195
OPEN ISSUES 28
GZIP SIZE 5.8 kB
UNPACKED SIZE 80.3 kB
DEPENDENCIES 4
LAST UPDATED 11mo ago
DOWNLOAD TRENDS

wouter downloads · last 12 months

Download trends for wouter1 download series from Nov 2025 to Oct 2026. Use left and right arrow keys to inspect monthly values.02.7M5.3M8.0M10.7MNov 2025FebMayAugOct 2026
wouter
ABOUT WOUTER

wouter is a client-side routing library for React that maps URL paths to the components rendered by an application. It addresses the need to connect navigation and route-specific views without requiring a large routing framework, and is described as a minimalist-friendly router of about 1.5KB.

Its design favors a small API and a low-dependency footprint over an extensive, all-in-one routing system. That makes wouter relevant to React developers who want routing primitives they can compose with their existing component structure, rather than a broad set of framework conventions; its topics also include Preact, React hooks, TypeScript, and zero-dependency development.

Wouter uses React hooks and components for route matching and navigation. Its API includes the `Route` component for associating a path with rendered content, `Link` for navigation, and hooks such as `useRoute` and `useLocation` for reading or changing the current route; these patterns let components respond to location changes without putting all routing logic in a central configuration.

The package is intended for React applications and is also associated with Preact, so it can fit projects in either ecosystem that prefer a compact router interface. At version 3.13.0, it has 898.9K weekly downloads, 7.9K GitHub stars, 193 forks, and 23 open issues; the stated license is Unlicense.

The supplied package data lists an 80.3 kB unpacked size and a 5.8 kB gzip bundle size, while the description characterizes it as approximately 1.5KB. Treat these as distinct size figures rather than interchangeable measurements, and check the build output for the configuration you ship. Its minimalist scope is also a consideration: teams needing a more comprehensive routing system should verify that its available routing primitives cover their requirements.

WHEN TO USE
  • Use `Route` to render a component for a matching URL path without introducing a larger routing configuration layer.
  • Use `Link` for navigation between route paths in a React interface while keeping navigation expressed in components.
  • Use `useLocation` when a component needs to read or update the current location as part of its UI behavior.
  • Use `useRoute` when a component needs to test whether the current path matches a particular route pattern.
  • Choose wouter when you want React-hook-based routing primitives and prefer to compose route handling within your component tree.
  • Consider it for a Preact project when its routing needs align with wouter's stated React and Preact ecosystem focus.
  • Evaluate it for a dependency-conscious application where the listed 5.8 kB gzip bundle size is relevant to the routing choice.
WHEN NOT TO USE
  • Avoid wouter if your application requires routing capabilities beyond the primitives you have verified in its API; choose a more comprehensive routing system that documents those capabilities.
  • Avoid it if your team expects a centralized route configuration and conventions that are not part of the minimalist component-and-hook approach; use a router designed around that architecture.
  • Avoid it if your project does not use React or Preact; select a routing solution intended for your framework or runtime.
  • Avoid relying on the description's approximately 1.5KB figure as the sole bundle-size basis, since the supplied data also lists 5.8 kB gzip; inspect your own production build or compare measured outputs.
  • Avoid adopting it if your project requires a license other than Unlicense; review the licensing requirement and select a package with a compatible license.
  • Avoid it if your routing requirements depend on features you cannot confirm from the package documentation; verify support first or use a router whose documented API explicitly covers them.

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 ★ 15.4K · 29.1M/wk wouter vs react-router ★ 56.7K · 79.3M/wk wouter vs @remix-run/router ★ 56.7K · 24.3M/wk