Skip to content

INTRO

Loom is a framework for building user interfaces, for any plateform.

You define declarative components written in pure Go, and loom renders them using a plateform-specific renderer.

// define your component
func Counter() Node {
	count, setCount := Signal(0)

    go func() {
        for {
            time.Sleep(time.Second / 30)
            setCount(count() + 1)
        }
    }()

	return P(Text("Count: "), BindText(count))
}

func main() {
	app := term.NewApp()

    // render it using our terminal renderer
    errs := app.Run(term.RenderInline, Counter)
}

// define your component
func Counter() Node {
	count, setCount := Signal(0)

    go func() {
        for {
            time.Sleep(time.Second / 30)
            setCount(count() + 1)
        }
    }()

	return P(Text("Count: "), BindText(count))
}

func main() {
	app := web.NewApp()

    // render it using our web renderer
    errs := app.Run("#root", Counter)
}

If you’re coming from JavaScript, this should feel very familiar.

You can use it to build and compose as many components as your UI needs. From simple static components, to complex UI layouts with hundreds or thousands of moving parts.


If you’d like to run you first app -> QUICK START

Or to keep reading about loom and how it works -> CORE CONCEPTS