goshtoso

module
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 1, 2026 License: MIT

README

Goshtoso

Goshtoso mascot

⚠️ Work-In-Progress

There is still lots of rough edeges to iron out, most related to preserving Alpine.js state when a wired component is swapped in by HTMX.

Goshtoso: Go + Templ + Tailwind CSS + HTMX + Alpine.js

About This Fork

This is a hard fork of Penguin UI by Salar Houshvand (source here), transformed from static HTML/Alpine.js components into a complete Go web component library.

What's Changed?
Original Goshtoso Fork
Static HTML Go + Templ templates
CDN assets Configurable (CDN/Embedded/Custom)
Copy-paste go get importable
Alpine.js only HTMX + Alpine.js + Go backend

Credits

CSS Integration

Goshtoso ships a CLI tool that extracts the pre-built Tailwind CSS from the embedded assets. Client applications use this instead of manually copying CSS files.

# Via go tool (recommended — version-pinned in go.mod)
go tool goshtoso -out=css/goshtoso-base.css

# Or via go run (for one-off use)
go run github.com/araihu/goshtoso/cmd/goshtoso@latest -out=goshtoso-base.css

Then import it in your Tailwind entry point:

@import "tailwindcss";
@import "./goshtoso-base.css";

See docs/USAGE.md for full setup instructions.

Project Structure

goshtoso/
├── cmd/
│   ├── server/              # Demo server
│   └── goshtoso/              # CSS extraction CLI tool
├── components/              # Goshtoso component library (32 components)
│   └── badge/
│       ├── types.go         # Configuration types
│       └── badge.templ      # Templ component
├── assets/
│   ├── embed.go             # Embedded assets + StylesCSS() accessor
│   ├── styles.css           # Compiled Tailwind CSS
│   ├── js/                  # Alpine.js, HTMX, plugins
│   └── fonts/               # TOTVS brand fonts
├── internal/
│   └── pages/demo/          # Demo pages
├── tests/e2e/               # Playwright E2E tests
└── docs/                    # Integration guides

Running the Demo

# Install dependencies (including Air)
make install
make install-air

# Run with live reload (auto-rebuilds on file changes)
make dev-air

# Server will start on http://localhost:8090
# Accordion Demo: http://localhost:8090/components/accordion
# Button Demo: http://localhost:8090/components/button
Standard Development
# Install dependencies
make install

# Run the demo server
make dev
# or
go run cmd/server/main.go

# Server will start on http://localhost:8090
# - Original PenguinUI: http://localhost:8090/original/
# - Goshtoso Components: http://localhost:8090/gottha/

Running E2E Tests

E2E tests use playwright-go (following the tks-console pattern) for Go-based browser automation.

# Using just (from repo root)
just gp-test-e2e                    # Run all E2E tests
just gp-test-e2e-one TestButton     # Run specific test

# Or directly
go test ./goshtoso/tests/e2e/... -v

# First time setup - install Playwright browsers
just gp-install-playwright
# or
go install github.com/playwright-community/playwright-go/cmd/playwright@v0.5700.1
playwright install chromium
Test Results

Tests automatically:

  • Start the demo server
  • Run browser automation tests
  • Capture screenshots on failures to test-results/screenshots/
  • Verify both Original PenguinUI and Goshtoso component rendering
Current Test Coverage
  • Button Component: Verifies all 8 variants render correctly, HTMX attributes, Alpine.js integration
  • Screenshots: Auto-captured for visual debugging

Component Usage

Button Component
import "github.com/araihu/goshtoso/components/button"

// Basic button
@button.Button(button.Config{
    Variant: button.Primary,
    Type:    "button",
}) {
    Click Me
}

// With HTMX
@button.Button(button.Config{
    Variant: button.Primary,
    HTMX: &button.HTMXConfig{
        Post:   "/api/action",
        Target: "#result",
        Swap:   "innerHTML",
    },
}) {
    Submit
}

// With Alpine.js
@button.Button(button.Config{
    Variant: button.Primary,
    Alpine: &button.AlpineConfig{
        OnClick: "modalIsOpen = true",
    },
}) {
    Open Modal
}

Development

Building
make build
Generating Templ Files
make generate
Testing
# Go tests
make test

# E2E tests
make test-e2e

License

MIT License - See original Penguin UI for details.

Directories

Path Synopsis
Package assets provides embedded static files (CSS, JS, fonts) for Goshtoso components.
Package assets provides embedded static files (CSS, JS, fonts) for Goshtoso components.
cmd
goshtoso command
Command goshtoso extracts embedded Goshtoso assets to disk.
Command goshtoso extracts embedded Goshtoso assets to disk.
server command
components
accordion
templ: version: v0.3.1020
templ: version: v0.3.1020
alert
templ: version: v0.3.1020
templ: version: v0.3.1020
avatar
templ: version: v0.3.1020
templ: version: v0.3.1020
badge
templ: version: v0.3.1020
templ: version: v0.3.1020
banner
templ: version: v0.3.1020
templ: version: v0.3.1020
breadcrumbs
templ: version: v0.3.1020
templ: version: v0.3.1020
button
templ: version: v0.3.1020
templ: version: v0.3.1020
card
templ: version: v0.3.1020
templ: version: v0.3.1020
carousel
templ: version: v0.3.1020
templ: version: v0.3.1020
chatbubble
templ: version: v0.3.1020
templ: version: v0.3.1020
checkbox
templ: version: v0.3.1020
templ: version: v0.3.1020
codeblock
templ: version: v0.3.1020
templ: version: v0.3.1020
combobox
templ: version: v0.3.1020
templ: version: v0.3.1020
combobox/v2
templ: version: v0.3.1020
templ: version: v0.3.1020
drawer
templ: version: v0.3.1020
templ: version: v0.3.1020
dropdown
templ: version: v0.3.1020
templ: version: v0.3.1020
fileinput
templ: version: v0.3.1020
templ: version: v0.3.1020
form
templ: version: v0.3.1020
templ: version: v0.3.1020
head
templ: version: v0.3.1020
templ: version: v0.3.1020
keyvalue
templ: version: v0.3.1020
templ: version: v0.3.1020
modal
templ: version: v0.3.1020
templ: version: v0.3.1020
navbar
templ: version: v0.3.1020
templ: version: v0.3.1020
pagination
templ: version: v0.3.1020
templ: version: v0.3.1020
palette
templ: version: v0.3.1020
templ: version: v0.3.1020
radio
templ: version: v0.3.1020
templ: version: v0.3.1020
schemafield
templ: version: v0.3.1020
templ: version: v0.3.1020
select
templ: version: v0.3.1020
templ: version: v0.3.1020
sidebar
templ: version: v0.3.1020
templ: version: v0.3.1020
spinner
templ: version: v0.3.1020
templ: version: v0.3.1020
steps
templ: version: v0.3.1020
templ: version: v0.3.1020
table
templ: version: v0.3.1020
templ: version: v0.3.1020
tabs
templ: version: v0.3.1020
templ: version: v0.3.1020
tagslist
templ: version: v0.3.1020
templ: version: v0.3.1020
textarea
templ: version: v0.3.1020
templ: version: v0.3.1020
textinput
templ: version: v0.3.1020
templ: version: v0.3.1020
toast
templ: version: v0.3.1020
templ: version: v0.3.1020
toggle
templ: version: v0.3.1020
templ: version: v0.3.1020
tooltip
templ: version: v0.3.1020
templ: version: v0.3.1020
triplet
templ: version: v0.3.1020
templ: version: v0.3.1020
internal
examples/chat
Package chat holds the pure, HTTP-free domain for the /examples/chat app: a deterministic ELIZA bot, the identity cookie, and a RAM-only broadcast hub.
Package chat holds the pure, HTTP-free domain for the /examples/chat app: a deterministic ELIZA bot, the identity cookie, and a RAM-only broadcast hub.
examples/logs
Package logs is the pure (HTTP-free) domain for the Live Log Feed example: a deterministic synthetic log-line generator.
Package logs is the pure (HTTP-free) domain for the Live Log Feed example: a deterministic synthetic log-line generator.
examples/profile
Package profile holds the pure, HTTP-free domain model for the /examples/profile app.
Package profile holds the pure, HTTP-free domain model for the /examples/profile app.
examples/ticker
Package ticker is the HTTP-free domain layer for the /examples/ticker example: a deterministic, seeded stock-price simulator plus a pub/sub broker that fans each tick out to all SSE subscribers.
Package ticker is the HTTP-free domain layer for the /examples/ticker example: a deterministic, seeded stock-price simulator plus a pub/sub broker that fans each tick out to all SSE subscribers.
examples/todo
internal/examples/todo/cookie.go
internal/examples/todo/cookie.go
pages/demo
templ: version: v0.3.1020
templ: version: v0.3.1020
pages/demo/components
templ: version: v0.3.1020
templ: version: v0.3.1020
pages/demo/examples
templ: version: v0.3.1020
templ: version: v0.3.1020
scripts
skillgen command
Command skillgen derives the Goshtoso component API reference from source.
Command skillgen derives the Goshtoso component API reference from source.
tests
e2e

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL