Framework UI Go g-sui

VérifiéSûr

Framework UI côté serveur pour Go avec rendu HTML serveur, composants réutilisables et interactivité via actions serveur et WebSockets.

Spar Skills Guide Bot
DeveloppementIntermédiaire
3002/06/2026
Claude Code
#go#server-rendered-ui#web-framework#ui-components

Recommandé pour

Notre avis

Framework Go pour construire des interfaces utilisateur rendues côté serveur, avec composants, formulaires et mises à jour en temps réel via WebSocket.

Points forts

  • Architecture entièrement côté serveur simplifiant la logique métier et l'état
  • Composants modulaires et réutilisables en Go
  • Gestion avancée des formulaires et des actions serveur
  • Mises à jour en temps réel via WebSocket sans JavaScript complexe

Limites

  • Nécessite une bonne connaissance de Go
  • Documentation partielle (fichiers MD séparés)
  • Communauté probablement petite
Quand l'utiliser

Pour développer des applications web Go nécessitant une interface utilisateur dynamique avec interactions serveur et mises à jour en temps réel.

Quand l'éviter

Pour des applications web très interactives côté client ou lorsque React/Vue sont déjà maîtrisés.

Analyse de sécurité

Sûr
Score qualité88/100

The skill provides documentation and standard development commands (go test, go build, deploy script). No destructive, exfiltrating, or obfuscated actions are present.

Aucun point d'attention détecté

Exemples

Create a basic page with g-sui
Using g-sui, create a Go web application with a home page that displays a greeting message and a button that increments a counter. The counter state should be managed on the server and updated via a server action.
Set up a form with server action
In g-sui, implement a contact form with fields for name, email, and message. On submission, use a server action to validate and display a success alert. Use the Form component from g-sui.
Create a data table with sorting
Using g-sui's data management features, create a page that displays a table of users with columns for name, email, and role. Enable sorting by name and filtering by role. Use the data collation utilities from the framework.

name: g-sui description: Server-rendered Go UI framework. Use when building g-sui applications, creating UI components, handling forms with server actions, using data tables, setting up routes, or implementing WebSocket patches. Triggered by "g-sui", "server-rendered UI", "Go UI framework", form handling, or data collation. allowed-tools: Read, Grep, Glob, Bash, Edit, Write

g-sui Framework

Server-rendered UI framework for Go. All HTML generation, business logic, and state management occur on the server. Interactivity achieved through server actions and WebSocket patches.

Quick Start

package main

import "github.com/michalCapo/g-sui/ui"

func main() {
    app := ui.MakeApp("en")

    app.Page("/", func(ctx *ui.Context) string {
        return app.HTML("Home", "bg-gray-100",
            ui.Div("p-8")(
                ui.Div("text-2xl font-bold")("Hello World"),
            ),
        )
    })

    app.Listen(":8080")
}

Documentation Index

| Topic | File | Description | |-------|------|-------------| | Core Concepts | CORE.md | Architecture, Context, Actions, Targets, server rendering | | UI Components | COMPONENTS.md | Buttons, inputs, forms, tables, alerts, cards, tabs, etc. | | Data Management | DATA.md | Data collation, search, sort, filter, pagination, Excel export | | Server Setup | SERVER.md | App initialization, routes, WebSocket, PWA, assets | | Best Practices | PATTERNS.md | Testing, validation, security, state management |

Core Philosophy

  1. Server-Centric Rendering - All HTML generated server-side as strings
  2. String-Based Components - Components are Go functions returning HTML strings
  3. Action-Based Interactivity - User interactions trigger server handlers returning HTML
  4. WebSocket-Enhanced - Real-time updates via /__ws endpoint

Key Types

type Callable = func(*ui.Context) string  // All handlers return HTML
type Attr struct { ID, Class, Value, OnClick, OnSubmit, ... }  // HTML attributes

Common Imports

import "github.com/michalCapo/g-sui/ui"

Development Commands

go run examples/main.go      # Run example app
go test ./...                # Run all tests
go test ./ui/...             # Test UI package
go build                     # Build project
./deploy                     # Create and push new version tag

Releases

To create a new version release:

./deploy

The deploy script automatically:

  • Starts at version v0.100 if no tags exist
  • Increments the minor version by 1 (e.g., v0.100v0.101v0.102)
  • Ensures working tree is clean before tagging
  • Creates an annotated git tag and pushes to remote

Version numbering: v0.XXX format, auto-incremented from v0.100.

Skills similaires