Skip to content
Frontend Nav
中文 (Language)

Recommend a site

Leave a name and a URL — submitting opens the recommendation page on GitHub to finish.

A ~2KB minimalist router for React and Preact — hooks-first and a featherweight React Router alternative

Content updated · 2026-09-14

What is it · 它是什么

What is wouter?

wouter is a minimalist routing library for React and Preact: about 2.2KB minified+gzip with zero dependencies, mimicking React Router's best practices while stripping the bulk. It offers both a hooks API (useLocation/useRoute/useParams) and a component API (Route/Link/Switch), with SSR, hash routing, nested routes and View Transitions support. Released under the Unlicense (public domain) — free for any commercial use; 7.9K stars and actively maintained. The go-to pick for small projects and embedded UIs that don't need the full data-loader stack.

How to use · 怎么用

How to use wouter

  1. In small projects, write routes directly with useRoute/useLocation — no top-level Router required.
  2. Follow the README's migration examples to slim down from React Router.
  3. Ultra-minimal cases can use the 650-byte useBrowserLocation hook alone.

Key features · 核心特点

Key features of wouter

  • ~2.2KB gzip, zero dependencies
  • Both hooks and component APIs; top-level Router optional
  • SSR, nested routes, hash routing and View Transitions
  • Unlicense (public domain) — use anywhere, commercially too

Related sites

12 free 3D tools in one page - image-to-3D, normal maps, remesh, reduce; file tools stay local

The framework for content-driven sites — zero JS by default, React/Vue islands where needed

The world's most popular front-end framework - v6 brings CSS-first theming and AI-assistant docs