What problem does it solve?
g-sui addresses the complexity of building dynamic, server-rendered UIs in Go by centralizing rendering, interaction logic, and state on the server. This approach reduces client-side JavaScript, speeds up development, and simplifies maintenance.
Core Features & Use Cases
- Server-rendered components: Compose interactive UIs directly from Go strings, without heavy client frameworks.
- Action-based interactivity: Use server actions (Click, Submit, etc.) to update UI and handle business logic.
- WebSocket patches: Push real-time updates to the DOM with patch-based swaps, keeping pages snappy.
- Data & forms: Built-in data tables, filtering, validation, and form helpers to accelerate data-driven apps.
- Use Case: Build a dashboard with live updates, forms, and a data table where only changed parts are re-rendered.
Quick Start
Install Go 1.21+ and fetch the library, then create a minimal app:
- go get github.com/michalCapo/g-sui
- Create main.go that uses ui.MakeApp("en"), define a page at "/" returning app.HTML(...), and run with app.Listen(":8080").