lotusui
A Go design system for desktop and mobile — one codebase, native apps. Web when you want it.
GitHub

Quickstart

A themed native window with a button, in one Go file.

NewTheme builds the one Theme instance — palette plus the embedded DM Sans font. Pass it to every component. The event loop is a standard Go app loop (Gio): paint the canvas, lay out content in the readable column, hand the frame back.

A minimal app

Go
package main

import (
	"log"
	"os"

	"gioui.org/app"
	"gioui.org/layout"
	"gioui.org/op"
	"gioui.org/widget"

	lotusui "github.com/ikaito-com/lotusui"
)

func main() {
	go func() {
		w := new(app.Window)
		w.Option(app.Title("hello"))
		if err := loop(w); err != nil {
			log.Fatal(err)
		}
		os.Exit(0)
	}()
	app.Main()
}

func loop(w *app.Window) error {
	th := lotusui.NewTheme()
	var btn widget.Clickable
	var ops op.Ops
	for {
		switch e := w.Event().(type) {
		case app.DestroyEvent:
			return e.Err
		case app.FrameEvent:
			gtx := app.NewContext(&ops, e)
			lotusui.Fill(gtx, th.Palette.Bg)
			lotusui.LayoutPage(th, gtx, func(gtx layout.Context) layout.Dimensions {
				return lotusui.Button(th, &btn, "Hello", lotusui.ButtonProps{})(gtx)
			})
			e.Frame(gtx.Ops)
		}
	}
}

lotusui is a Go design system for native desktop and mobile — and the web when you want it. Docs demos are the real components (WebAssembly) — one gallery app, each Preview an iframe addressed by URL hash.