Hugo Nijhuis a13e215e31
All checks were successful
CI / build (pull_request) Successful in 27s
CI / build (push) Successful in 28s
Add multi-page app example demonstrating navigation
Add a comprehensive example showing client-side routing:
- Router setup with multiple routes (/, /about, /users, /admin)
- Route parameters (/users/:id) with the NumericIdGuard
- Navigation using Link component and programmatic Navigate/Back
- Route guards with AuthGuard for protected admin page
- Browser history integration with back/forward support

Closes #6

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-09 17:01:47 +01:00
2026-01-08 19:23:49 +01:00
2026-01-09 16:50:55 +01:00
2026-01-08 19:23:49 +01:00
2026-01-08 19:23:49 +01:00
2026-01-08 19:39:15 +01:00
2026-01-08 19:23:49 +01:00
2026-01-08 19:23:49 +01:00
2026-01-08 19:23:49 +01:00
2026-01-08 19:39:15 +01:00

Iris

WASM reactive UI framework for Go.

Quickstart

Get from zero to a running app in under 5 minutes.

Prerequisites

  • Go 1.23 or later

Project setup

mkdir -p public
cp "$(go env GOROOT)/misc/wasm/wasm_exec.js" ./public/

Create your app

Save this as main.go:

//go:build js && wasm

package main

import (
	"fmt"

	"git.flowmade.one/flowmade-one/iris/reactive"
	"git.flowmade.one/flowmade-one/iris/ui"
)

func main() {
	count := reactive.NewSignal(0)

	view := ui.NewView()
	view.Child(ui.TextFromFunction(func() string {
		return fmt.Sprintf("Count: %d", count.Get())
	}))
	view.Child(ui.Button(func() {
		count.Set(count.Get() + 1)
	}, ui.TextFromString("Click me")))

	ui.NewApp(view)

	// Keep the program running
	select {}
}

Create the HTML host

Create public/index.html:

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>Iris App</title>
    <script src="wasm_exec.js"></script>
    <script>
        const go = new Go();
        WebAssembly.instantiateStreaming(fetch("app.wasm"), go.importObject).then((result) => {
            go.run(result.instance);
        });
    </script>
</head>
<body></body>
</html>

Build

GOOS=js GOARCH=wasm go build -o public/app.wasm ./main.go

Run

Save this as server.go:

package main

import (
	"net/http"

	"git.flowmade.one/flowmade-one/iris/host"
)

func main() {
	server := host.New("public", "index.html")
	http.ListenAndServe(":8080", server)
}

Then run:

go run server.go

Expected output

Open http://localhost:8080 in your browser. You should see:

  • A "Count: 0" text
  • A "Click me" button
  • Clicking the button increments the count reactively
Description
WASM reactive UI framework for Go
Readme 1,012 KiB
Languages
Go 99.8%
Makefile 0.2%