Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Claude loads one when your task matches it, or you run it by name.
Public GitHub repos that commit this plugin as enabled in their Claude Code settings
1 marketplace, most starred first
gomponents, go-html, html-components, templating, server-side-rendering, golang, web-ui
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
npx claudepluginhub maragudk/gomponents --plugin gomponentsBuilt from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.
Plugins from other owners that cover similar ground
Try HTML components in pure Go.
gomponents are HTML components written in pure Go. They render to HTML 5, and make it easy for you to build reusable components. So you can focus on building your app instead of learning yet another templating language.
go get maragu.dev/gomponents
Made with ✨sparkles✨ by maragu: independent software consulting for cloud-native Go apps & AI engineering.
Contact me at [email protected] for consulting work, or perhaps an invoice to support this project?
Check out www.gomponents.com for an introduction or pkg.go.dev/maragu.dev/gomponents for the official docs.
gofmt/goimportsText and Textf that insert HTML-escaped text,Raw and Rawf for inserting raw strings,Map for mapping data to components and Group for grouping components,If/Iff for conditional rendering.go get maragu.dev/gomponents
package main
import (
. "maragu.dev/gomponents"
. "maragu.dev/gomponents/components"
. "maragu.dev/gomponents/html"
)
func Navbar(authenticated bool, currentPath string) Node {
return Nav(
NavbarLink("/", "Home", currentPath),
NavbarLink("/about", "About", currentPath),
If(authenticated, NavbarLink("/profile", "Profile", currentPath)),
)
}
func NavbarLink(href, name, currentPath string) Node {
return A(Href(href), Classes{"is-active": currentPath == href}, Text(name))
}
(Some people don't like dot-imports, and luckily it's completely optional.)
For a more complete example, see the examples directory. There's also the gomponents-starter-kit for a full application template.
There's a skill that teaches coding agents how to use gomponents. It's also a good, concise introduction to gomponents for humans. Install it as a plugin:
/plugin marketplace add maragudk/gomponents
/plugin install gomponents@gomponents
Run these commands from a local clone:
codex plugin marketplace add maragudk/gomponents
codex plugin add gomponents@gomponents
gomponents is organized into several packages:
gomponents: Core interfaces and functions like Node, El, Attr, and helpers like Map, Group, If, Text, Raw.gomponents/html: HTML elements and attributes.gomponents/components: Higher-level components and utilities.gomponents/http: HTTP-related utilities for web servers.gomponents/x/...: Experimental packages. These do not have the same compatibility guarantees as the core library, and in particular, may get breaking changes.Void elements in HTML (like <br>, <img>, <input>) don't have closing tags.
gomponents handles these correctly by checking against an internal list of void elements during rendering.
When you create a void element, any child nodes that are not attributes will be ignored automatically to ensure valid HTML output.
Yes! gomponents is mature, stable, fully tested with 100% coverage, and is used in production by myself and many others, and has been for years.
html/template, Templ, or gomponents?These are all good choices, and it largely comes down to preference.
I wrote gomponents because I didn't like how I think it's hard to pass data around between templates in html/template.
gomponents is pure Go, with no extra build step like Templ, so it works with all tools that already support Go.
That said, both html/template and Templ will do the same thing as gomponents in the end. Try them all and choose what you like!