Skip to content
Library
Routing

wouter-preact

Tiny router with a hook-first API for Preact applications.

Native PreactActive

Native Preact

Built for Preact and does not require a React compatibility layer.

Packagewouter-preact

Facts at a glance
Preact compatibility
Native Preact
Tested Preact versions
Not documented
TypeScript
Native TypeScript
SSR
SSR supported
Maintenance
Active
License
MIT
Last verified
Not yet verified
Terminal
npm install wouter-preact
Preact example
import { Link, Route, Switch } from "wouter-preact"; export function App() {  return (    <>      <nav><Link href="/docs">Docs</Link></nav>      <Switch>        <Route path="/docs">Docs page</Route>      </Switch>    </>  );}

Introduction

`wouter-preact` is attractive when you want a tiny runtime and a route API based on hooks.

Preact configuration

Import router helpers directly from `wouter-preact`.

SSR notes

The package can fit SSR setups as long as you control location handling explicitly.

Islands notes

Works well for lightweight island shells and interactive subsections.

Alternatives