A minimalist-friendly ~2.2KB routing library for React and Preact apps, built with hooks.
Wouter is a minimalist routing library for React and Preact applications that leverages React Hooks for declarative navigation. It solves the problem of bloated routing solutions by offering a tiny (~2.2KB) alternative with a familiar API, making it perfect for projects where bundle size matters.
Frontend developers building React or Preact applications who prioritize performance, minimal bundle size, and a hooks-based architecture. It's especially suited for those migrating from React Router seeking a lighter alternative.
Developers choose Wouter for its exceptional balance of size and functionality—it provides essential routing features like nested routes, SSR support, and a React Router-like API while being significantly smaller. Its hook-first design offers greater flexibility for custom routing logic and animations.
🥢 A minimalist-friendly ~2.2KB routing for React and Preact
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
At only ~2.2KB gzipped, it's significantly smaller than React Router (18.7KB), making it ideal for performance-critical applications as highlighted in the README's size comparison.
Provides granular control with hooks like useLocation and useRoute, allowing custom routing logic and animations without bloated APIs, as demonstrated in the hooks API section.
Offers Route, Link, Switch, and Redirect components that mimic React Router's best practices, easing migration for developers, as noted in the features list.
Works seamlessly with both React and Preact ecosystems via a separate package, broadening its usability for lightweight frameworks, as detailed in the Preact support section.
Lacks built-in support for animated transitions; the README admits developers must use workarounds with external libraries like framer-motion and custom aroundNav handlers.
Has fewer third-party integrations and plugins compared to established routers like React Router, which might require more custom code for complex use cases.
Server-side rendering requires manual setup with ssrPath and ssrSearch props, adding complexity compared to routers with more automated SSR solutions.
wouter is an open-source alternative to the following products: