Render
An Element that implements templ.Component. Props cross as attributes,
objects and arrays included, so the page is complete before any JavaScript
has run.
alacris is a ~6 kB web component library built on signals and fine-grained DOM updates. alacris-go is the server half. It renders the elements, gets the props across the boundary, generates typed Go wrappers from your components, and can make the server authoritative over what those components show.
return alacris.E("user-card"). Prop("name", "Ada"). Prop("age", 36). Prop("tags", []string{"math", "code"})<user-card name="Ada" age="36" tags="["math","code"]"></user-card>Props are kebab-cased and encoded by their Go type.
A prop is a signal on the other side. When the server changes something, it writes one property, which wakes one binding, which updates one DOM node.
sess.Element("board").Set("items", list.Items())No HTML on the wire. Focus, scroll position and half-typed text survive, because no node is replaced.
Render
An Element that implements templ.Component. Props cross as attributes,
objects and arrays included, so the page is complete before any JavaScript
has run.
Generate
alacris-go generate reads your define() calls and writes typed Go
wrappers, typed event details and slot constants. One source of truth.
Go live
Push prop changes over SSE, receive component events over POST.
No npm required
The alacris runtime is vendored into the Go module and served from Go. A Go project needs no JavaScript toolchain to ship.
A design system
Alacris UI ships in the module: sixty-eight Material Design 3 components,
typed wrappers, and a theme engine. Config.UI turns it on without a
second toolchain.
go get github.com/bmartel/alacris-gomux.Handle("/_alacris/", alacris.RuntimeHandler())Start here covers what the server can and cannot render. The runnable example is a live Kanban board:
go run ./examples/todoThe shadow content of a component is built by setup() in the browser.
There is no server-side rendering of component internals and no declarative
shadow DOM. What Go renders is the element, its props and its light-DOM slot
children. See Limitations before you
commit to it.