Wouter screenshot

Wouter

Author Avatar Theme by Molefrog
Updated: 18 Dec 2025
7713 Stars

A minimalist-friendly ~2.2KB routing for React and Preact

Overview

Wouter has emerged as a lightweight alternative in the realm of routing for React and Preact applications. With its minimalistic design, it captures the essential functionalities needed for effective routing while keeping the bundle size small. This focus on simplicity and performance makes it an appealing choice for developers looking to streamline their applications without compromising essential features.

What sets Wouter apart is its embrace of modern React hooks, allowing for more control and flexibility over routing. This means developers can implement complex routing features with ease and can maintain the familiarity of components typically found in React Router. The combination of a small footprint and an intuitive API makes Wouter a standout option in the React ecosystem.

Features

  • Minimal Dependencies: At just 2.1 KB gzipped, Wouter is significantly lighter than many competing libraries, making it ideal for performance-sensitive applications.
  • React and Preact Support: The library is designed to work seamlessly with both React and Preact, enhancing versatility for different project requirements.
  • No Top-Level <Router /> Component: Wouter allows for more flexibility by making the top-level <Router /> component optional, which can simplify component hierarchies.
  • Familiar Components: Developers will find comfort in Wouter’s familiar components such as Route, Link, Switch, and Redirect, mimicking popular patterns from React Router.
  • Hook-Based API: The use of hooks like useLocation, useRoute, and useRouter offers granular control over routing behaviors, enabling developers to implement features like animations easily.
  • Extensive API Options: Wouter includes a range of hooks for route parameter extraction, query string management, and more, catering to advanced routing needs.
  • Flexibility in API Choices: With low-level standalone location hooks and a more traditional component-based API, developers can choose what best suits their project needs.
  • Support for Modern Features: Designed for ES2020+ compatibility, Wouter is ready for the latest JavaScript advancements while still supporting older browser compatibility with proper transpilation.