Skip to content

About

The collection of Waku examples

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

waku-examples

A collection of Waku examples, grouped by the Waku API they use, since that is the choice that most shapes how an app is written:

If you are instead looking for a particular topic (styling, forms, state, deployment, etc.), jump to the topic index.

By API

fs-router

File-system routing under src/pages. Most examples run in managed mode (no server entry); those marked explicit provide a src/waku.server.tsx that calls fsRouter directly, usually to customize the adapter.

Example What it shows
basic Basic app (Tailwind CSS, React Compiler)
basic-js Basic app in JavaScript
data-fetching Async server components fetching data
css-modules Scoped styling with CSS Modules
stylex Styling with StyleX (zero-runtime CSS-in-JS)
vanilla-extract Styling with Vanilla Extract (compile-time CSS-in-JS)
form Server actions and form handling
jotai Global state with Jotai (waku-jotai)
features Feature tour: layouts, slices, segments, API routes (explicit)
tanstack-router Replace the client router with TanStack Router (explicit)
no-ssr Disable SSR for client-only rendering (explicit)
cloudflare Deploy to Cloudflare Workers (explicit)
nextjs-blog-starter Next.js blog-starter, migrated: static generation, metadata, markdown
nextjs-dashboard Next.js Learn dashboard, migrated: auth, a database, server actions, search
nextjs-commerce Next.js Commerce, migrated: cookies, optimistic UI, sitemap and OG images
nextjs-photo-modal Nextgram, reimplemented: parallel and intercepting routes

create-pages

The low-level routing API. createPages registers routes programmatically (pages, layouts, slices, and API routes) from waku/router/server.

Example What it shows
basic Pages, layouts, slices, and API routes defined in code
react-tweet Embed a third-party component (react-tweet) with SSR
weave-render Weave async server components with client components
view-transitions Animate navigation with the View Transitions API

define-router

The lower-level unstable_defineRouter API, for building custom routing on top of Waku's router.

Example What it shows
basic Manual route configuration with unstable_defineRouter

minimal-api

The low-level RSC primitives from waku/minimal/*. Intended for library authors, custom runtimes, and learning how Waku works underneath.

Example What it shows
basic Minimal RSC + SSR with the minimal API (TypeScript)
basic-js Minimal RSC + SSR (JavaScript)
promise Stream RSC payloads and compose with <Children>
functions Server functions that return a value and re-render
nesting Nested slots and useRefetch
form Server actions with formState (progressive enhancement)
css CSS Modules with the classnames helper
cookies Read/write cookies and headers via Hono middleware
api Custom API endpoints alongside RSC
path-alias TypeScript path aliases (@/*)
spa Single-page-app mode (client-only) with server functions
islands Islands architecture (selective hydration)
jotai Jotai state with the minimal API (waku-jotai)

By topic

The same examples, grouped by what they teach.

Topic Examples
Getting started fs-router/basic, fs-router/basic-js, minimal-api/basic, minimal-api/basic-js
Routing fs-router/features, fs-router/tanstack-router, create-pages/basic, define-router/basic
Styling fs-router/css-modules, fs-router/stylex, fs-router/vanilla-extract, minimal-api/css
Data fetching fs-router/data-fetching
Mutations (forms, actions, API) fs-router/form, minimal-api/form, minimal-api/functions, minimal-api/api
State management fs-router/jotai, minimal-api/jotai
Rendering & architecture fs-router/no-ssr, create-pages/weave-render, minimal-api/promise, minimal-api/nesting, minimal-api/spa, minimal-api/islands
Navigation & UX create-pages/view-transitions
Request handling minimal-api/cookies
Integrations create-pages/react-tweet, fs-router/tanstack-router
Deployment fs-router/cloudflare
Tooling & config minimal-api/path-alias
Migrating from Next.js fs-router/nextjs-blog-starter, fs-router/nextjs-dashboard, fs-router/nextjs-commerce, fs-router/nextjs-photo-modal

Running an example

Each example is a standalone Waku project.

cd <group>/<name>
pnpm install
pnpm dev

About

The collection of Waku examples

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages