zfb
GitHub repository

Type to search...

to open search from anywhere

Recipes

Created May 20, 2026Updated Nov 11, 2026Takeshi Takatsudo

Self-contained patterns and worked example sites for zfb. Curated section — one topic per page.

A maintainer-curated section holding two kinds of page:

  • Focused recipes compose zfb's primitives — addVirtualModule, postBuild plugins, ctx.routes, non-HTML pages, MDX components — into one concrete solution you can adapt.

  • Worked example sites take a whole project and explain it end to end. Each has a public repository you can clone, and all but one have a live deployment you can open.

Either way, a page here is:

  • A single article on a single topic

  • Written as an explanation, not a code dump — the why matters as much as the how

  • Anchored to a specific zfb version range, so you know what state of the engine it assumes

The nine ordinary external example repositories pin their ZFB packages to 6.0.1 and declare Node.js >=24.0.0 (manifests checked at the immutable commits linked on each recipe, 2026-11-11). Their pnpm and Wrangler versions vary; use each recipe's prerequisite table rather than this monorepo's tooling. They use zudo-react, with configured zudo-wind utilities and authored CSS.

Agent Conversations is the historical exception: its walkthrough is dated 2026-10-01 at commit a21cc1081f656027d075c1e09c425e65f368f3ae. That snapshot's nested apps use ZFB 4.7.0 and its root declares Node.js >=22.16 / pnpm 10.12.1. It is not a current 6.0.1 recipe.

Recipes

  • Enlargeable Images — reproduce the old imageEnlarge built-in in userland using the img component override. Covers the server-rendered variant (shared layout JS, no island runtime or per-image bundle) and islands variant, plus the no-enlarge opt-out.

  • Admonitions — register :::note, :::tip, :::info, :::warning, :::danger, :::caution, and :::details using the directives feature with minimal component stubs and CSS hooks.

Example sites

Ten standalone repositories, each a complete zfb project. Nine are deployed and running on Cloudflare; Agent Conversations has no deployment and runs locally. Every page below covers one of them — what it demonstrates, the exact stack it uses, how it works, and how to run it locally — and links to the repository so you can clone it. Examples puts the same ten side by side as a comparison matrix.

  • Agent Conversations — a static shell with one zudo-react island over a framework-neutral conversation controller: queued runs, cancellation, and reviewed host changes, backed by a memory-only service or a local HTTP and SQLite server. The provider is synthetic and nothing is deployed.

  • AI Summarizer — one zudo-react island posting to a prerender = false route backed by a Workers AI binding, with a deterministic fallback so the endpoint still answers with no Cloudflare account.

  • Blog — a pure-SSG Markdown and MDX blog: three dynamic-route shapes, paginate(), one zudo-react theme-toggle island, and an authored CSS design system. zudo-wind supplies only its owned-v1 reset. No SSR, no adapter.

  • Corporate Website — a static zudo-react marketing site styled entirely with CSS Modules. It sets wind: false, so zudo-wind is disabled and the site uses only authored CSS.

  • JSON API — the smallest complete SSR starter: two prerender = false GET endpoints, one of which builds a MiniSearch index lazily and reuses it across warm-isolate requests. Nothing to provision.

  • KV Guestbook — a write path through a Cloudflare binding. One route both renders the entry list and handles a no-JavaScript form post against Workers KV, alongside a token-guarded admin delete.

  • Password Gate — a static site fronted by a hand-written Worker with run_worker_first = true, the one example that talks to Cloudflare without the zfb adapter. Its live demo answers 401 by design.

  • Reverse Proxy — a catch-all prerender = false route forwarding method, path, query, and body to a fixed upstream, with a deliberate header policy in both directions.

  • Webshop — a fully SSR shop on Cloudflare D1 with accounts, a cart, and checkout. Every route is prerender = false and every button is a form, so the build emits no HTML and no client JavaScript.

  • Workers Cache — caching expressed purely as HTTP: per-route Cache-Control, Cache-Tag, and Vary, plus a token-protected purge route calling ctx.cache.purge().

Revision History

Takeshi TakatsudoCreated: 2026-05-21T05:32:57+09:00Updated: 2026-11-11T15:40:45Z