HLive

Build interactive, real-time web UIs in pure Go. No JavaScript, no npm, no build step — just Go code that talks to the browser over a WebSocket.

Why HLive

If you know Go, you already have everything you need to build a modern, interactive web app. HLive lets you skip the second language: no JavaScript to write, no npm dependencies to audit, no frontend build pipeline to maintain, and no state to keep in sync by hand between a Go backend and a JS frontend. You write one program, in Go. HLive renders it as HTML, opens a WebSocket, and pushes only the DOM changes your Go code actually made — live, on every keystroke or click, without you writing a single line of client-side code.

🧠

One Language, Full Stack

Write your entire UI and its logic in Go. No context-switching to JavaScript, no duplicating validation or state between client and server.

📡

Live Over WebSocket

After the first request, HLive keeps a per-user session running server-side and streams minimal DOM patches over a WebSocket — your UI updates in real time without a page reload.

🧩

Components, Not Templates

Build your UI from Tag and Component values in real Go code, and bind browser events like click or keyup straight to Go handler functions.

📦

Zero JS Toolchain

No Node.js, no npm, no bundler, no client build step. Your entire build is go build.

See It In Action

Type into the input below and watch the page update live, no JavaScript to write, just the Go handler shown underneath:

Live Demo


Hello,

Source

func home() *l.Page { message := l.Box("") input := Input( Type("text"), l.On("keyup", func(ctx context.Context, e l.Event) { message.Set(e.Value) }), ) page := l.NewPage() page.DOM().Body().Add( Div(input), Hr(), "Hello, ", message, ) return page }

That's the whole interactive example — see the full tutorial for the runnable version with routing.

Installation

Add HLive to your Go module:

go get github.com/SamHennessy/hlive@latest

Then check out the Quick Start Tutorial to build your first page.