goshtoso

module
v0.0.3 Latest Latest
Warning

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

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

README

Goshtoso

Goshtoso mascot

CI Go Reference Go Report Card Latest tag

⚠️ 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

Two Go modules in one repo (a workspace): the library at the root and the demo site under site/.

goshtoso/                    # ROOT MODULE — library (github.com/araihu/goshtoso)
├── cmd/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
├── docs/                    # Integration guides
└── site/                    # SITE MODULE — demo + examples (…/goshtoso/site)
    ├── cmd/server/          # Demo server
    ├── internal/pages/demo/ # Demo pages
    └── tests/e2e/           # Playwright E2E tests

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 (run `go work init . ./site` once per clone for local dev)
make dev
# or
go run ./site/cmd/server

# 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 ./site/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 and reports versions.
Command goshtoso extracts embedded Goshtoso assets and reports versions.
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
scripts
skillgen command
Command skillgen derives the Goshtoso component API reference from source.
Command skillgen derives the Goshtoso component API reference from source.
themegen command
Command themegen generates assets/goshtoso-theme.css — the self-contained Goshtoso theme source a consumer imports into their own Tailwind v4 build.
Command themegen generates assets/goshtoso-theme.css — the self-contained Goshtoso theme source a consumer imports into their own Tailwind v4 build.
vendorgen command
Command vendorgen generates assets/vendor_gen.go from the runtime version manifest (assets/js/runtime/versions.json) — the single source of truth for every vendored third-party JS dependency's version, file, and origin.
Command vendorgen generates assets/vendor_gen.go from the runtime version manifest (assets/js/runtime/versions.json) — the single source of truth for every vendored third-party JS dependency's version, file, and origin.

Jump to

Keyboard shortcuts

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