WebGo zine No. 1.0.0 Printed in three inks on app.wasm Free. Take one. Nov 2026
v1.0.0 · First Edition

Build the whole web app in Go.

WebGo gives you pages, view models, markdown and typed CSS on its own app engine. Routing, state and stylesheets are plain Go that compiles to WebAssembly, so the compiler checks your UI the way it checks your server.

                  $ 
                  go get github.com/Toms223/WebGo@v1.0.0
                
Get started Star on GitHub one file ships: app.wasm
BUILT WITH GO · BUILT WITH GO · GO
counter.go gofmt, tabs
                  type
                   
                  Counter
                   
                  struct
                  { Count 
                  int
                   }


                  var
                   model, _ = app.
                  NewModel
                  (
                  "counter"
                  , &
                  Counter
                  {})


                  func
                   (l *Layout) 
                  Draw
                  (m *app.Model[
                  Counter
                  ]) app.HTMLDiv {

                  	
                  return
                   app.Div().Body(

                  		app.H1().Textf(
                  "%d"
                  , m.State().Count),

                  		app.Button().Text(
                  "+1"
                  ).OnClick(l.bump),

                  	)
}


                  func
                   (l *Layout) 
                  bump
                  (ctx app.Context, _ app.Event) {

                  	model.Load(ctx).Apply(
                  func
                  (_ app.Context, c *
                  Counter
                  ) *
                  Counter
                   {

                  		c.Count++

                  		
                  return
                   c

                  	}).Set()
}
                
fig. 1, a screen is a layout and a model
this is the whole app
01
Try it, it runs

Pull the press

Every bump of the counter goes through the three model verbs. Load takes the state, Apply changes it, Set stores it and redraws whatever reads it. This landing page is a Screen, so the press below is its own model.

model "home" Count = 0
0
Ready. Paper loaded.
02
What you get

Four things in the box

03
  • Go all the way down
  • ·
  • Compiles to WebAssembly
  • ·
  • Static site in one command
  • ·
  • Typed stylesheets
  • ·
  • Zero JavaScript to write
How it feels

One language, one mental model.

A screen is a Layout and a Model. The layout draws from the model, handlers apply changes, and the screen re-renders. Styles are values you can pass around, test and reuse.

  • Rename a CSS property and the build breaks, not the page.
  • Bind a class to state and the dynamic sheet recomputes on its own.
  • Ship the generated site to any static host, GitHub Pages included.
theme.go package theme
                    var
                     Button = style.
                    Class
                    (
                    "button"
                    ).

                    	
                    Set
                    (

                    
                      		css.
                      Padding
                      (css.Rem(0.6), css.Rem(1.1)),
                    
                    

                    		css.Border(css.Px(2), kw.Solid, css.Var(
                    "line"
                    )),

                    		css.BoxShadow(css.Var(
                    "shadow"
                    )),

                    	).

                    	
                    Hover
                    (css.Transform(css.Raw(
                    "translate(-2px, -2px)"
                    ))).

                    	
                    Media
                    (media.MaxWidth(css.Rem(48)), css.Width(css.Pct(100)))


                    func
                     (b *Buy) 
                    Render
                    () app.UI {

                    	
                    return
                     app.Button().Style(Button).Text(
                    "Buy"
                    )

                    }
                  
fig. 2, a stylesheet as Go values
drop one letter here...
                  $ 
                  GOARCH=wasm GOOS=js go build -o web/app.wasm .

                  ./theme.go:14:7: undefined: css.Paddin
                

...and the compiler catches it before a browser ever sees it.

04
Three steps

From go get to a running page

1

Install

Add WebGo to your module. Everything comes from this one import.

go get github.com/Toms223/WebGo@v1.0.0
2

Write a page

A component, a route and app.RunWhenOnBrowser. Then grow into Screens and Models.

app.Route("/", func() app.Composer { return &hello{} })
3

Build and ship

Compile to wasm and generate a static site, or serve it from the same binary.

GOARCH=wasm GOOS=js go build -o web/app.wasm .
05
Latest news

Fresh off the drum

WebGo zine

First Edition

Release 1.0.0 First Edition go get WebGo@v1.0.0

WebGo 1.0, and the release we skipped

Loading before drawing, pages in the engine, typed scripts, feature flags and a dev server. All of it lands at once as v1.0.0, and v0.2.0 never happens. Here's the whole story.

  • Update 1.0.0
  • 9 min read
06

Ready when you are.

The getting started guide takes you from an empty module to a static site. Every example on this site is live.

Open the docs