Source-owned UI components for Go projects using templ, Tailwind CSS, and a small vanilla JavaScript runtime for interactive primitives.
This repository is preparing for a v1 release. The CLI installs source files into user projects instead of depending on a shared component package.
go install ./clitemplcn init --name my-app
cd my-app
go mod tidy
go build ./...The generated project includes:
ui/component source filesassets/runtime.jsfor interactive primitivesstyles/globals.cssapp.templand generated starter Go code
templcn add button
templcn add dialog select
templcn add --all
templcn add select --dry-run
templcn view button
templcn diff buttonadd copies only the requested component, declared dependencies, shared render helpers, and runtime file when needed.
Run module tests:
(cd ui && go test ./...)
(cd cli && go test ./...)
(cd docs-site && go test ./...)Run browser behavior tests:
(cd docs-site && TMPDIR=$PWD/.tmp bun run test:e2e)Build docs:
(cd docs-site && bun install && bun run build:css && go run ./cmd/generate -output ./dist)- Component-scoped CLI install behavior is covered by acceptance tests.
- Interactive primitives have browser tests for keyboard, focus, state, dismissal, and form value behavior.
- CLI metadata includes files, dependencies, runtime requirements, CSS, docs URLs, and examples.
- Docs pages use component-specific install commands and concrete previews.