Each example builds on previous ones. Study them in order or jump to the pattern closest to your use case.
| # | Example | Features Introduced | WASM Demo |
|---|---|---|---|
| 01 | Hello World | App, background goroutine, auto-refresh polling, HandleRoot/HandleDisplay |
Run |
| 02 | SVG Graph | Synchronous render (no polling), SVG output via lofigui.HTML() |
Server-only |
| 03 | Hello World WASM | Go compiled to WASM, browser-only rendering, no server needed | Run |
| 04 | TinyGo WASM | Smaller WASM binaries with TinyGo (~2.7MB vs ~8MB standard Go) | Run |
| 05 | Demo App | Python template inheritance (Jinja2 extends/blocks) | Python-only |
| 06 | Notes CRUD | Form POST, Controller directly (no App), redirect-after-POST |
Server-only |
| 07 | Water Tank | SVG schematic generation (buildSVG), simulation goroutine, clickable SVG links, dual server/WASM |
Run |
| 08 | Water Tank Multi-Page | Multiple routes sharing one model, LayoutNavbar, per-page HTTP Refresh polling |
Run |
| 09 | Water Tank HTMX | HTMX partial updates, fragment endpoints, Controller without App, renderAndCapture mutex |
Run |
| 10 | Water Tank Maintenance | Background goroutines, context.Context cancellation, equipment lockout, progress tracking |
Run |
| 11 | SeaweedFS | SeaweedFS integration, file upload/verify/delete, auto-create, HTMX live updates | Server-only |
| 11 | Water Tank Storage | WASM + Go API server, JSON persistent storage, navigator.sendBeacon on unload, auto-save |
Run |