A lightweight, component-based Go web framework with templ integration that makes building modern web applications simple and maintainable.
go get github.com/troygilman/gong@latestGong lets you build web applications in Go using components with encapsulated state and behavior:
- 🧩 Component-based architecture with HTMX integration
- 🔌 Automatic form binding and state management
- 🛣️ Comprehensive routing with path parameters
- 🧠 Context system for state propagation
type CounterComponent struct {}
templ (c CounterComponent) View() {
@gong.Target() {
@counter(0)
}
}
templ (c CounterComponent) Action() {
{{
count, err := strconv.Atoi(gong.FormValue(ctx, "count"))
if err != nil {
return err
}
}}
@counter(count+1)
}
templ counter(count int) {
<p>Count: { strconv.Itoa(count) }</p>
@gong.Button() {
Increment
<input type="hidden" name="count" value={ strconv.Itoa(count) }/>
}
}For detailed documentation, examples, and guides, visit https://gong-wiki.fly.dev
Explore sample applications in the example directory.
MIT License - see the LICENSE file for details.