Adicione o goUI ao seu projeto Go existente:
▼
terminal
go get github.com/M4R4G0N/[email protected]
Adicione o goUI ao seu projeto Go existente:
go get github.com/M4R4G0N/[email protected]
Crie um arquivo main.go e comece a compor sua interface:
package main
import (
goui "github.com/M4R4G0N/goUI"
"github.com/M4R4G0N/goUI/components"
)
func main() {
app := goui.NewApp()
// 1. Cabeçalho (Meta e Barra Superior)
head := components.Headbar("Meu App goUI")
// 2. Barra Lateral (Vazia e limpa)
nav := components.Navbar("")
// 3. Conteúdo da Página
body := components.Div(
components.Icon("box", 48, "goui-text-primary goui-mb-20"),
components.Text("Olá, goUI!", "h1",
components.Class("goui-text-primary"),
components.Style{"font-size": "3.5rem"},
),
components.Div(
components.Class("goui-mt-20"),
components.Button("Clique Aqui", components.Disabled),
),
)
// Registra a rota usando LayoutCentered para alinhar tudo no meio
app.RegisterRoute("/", components.NewPage(head, nav, body, components.LayoutCentered))
app.Start("", "8080")
}