Public component constructors return concrete renderable values. Those values work anywhere a templ component is accepted and expose stable identity when generic code needs it.
A common renderable interface
Every public component value implements components.Component. The interface embeds templ.Component and adds stable component identity through Kind().
Public interface
typeComponentinterface{templ.ComponentKind()Kind}
Render returned values normally in templ. Keep the concrete return value when code uses component-specific behavior; use the common interface when a collection contains different components.
Constructor styles
There is no shared configuration type. Each package exposes only the fields or options supported by that component. The versioned pkg.go.dev link on every component page is the source of truth for exact constructor signatures.
Configuration structs
Components with structured data use package-specific config structs.
Constructors return exported values such as button.Instance, modal.AlertDialogInstance, and table.Instance. They still satisfy both common renderable interfaces.
A []components.Component can contain values from different packages. Call component.Kind() when a registry, diagnostic, or switch needs the stable identity of a component.
Kind values are stable kebab-case identifiers. They are not CSS classes or HTML element names.
Rendered defaults
A zero-valued field may render a documented default. Component pages demonstrate the rendered behavior; their versioned pkg.go.dev links document exported constructors, fields, options, and methods.
Goshtoso can store preferences and demo state in your browser. Some examples use cookies and IndexedDB to persist local demo state. There is no analytics, advertising, or third-party tracking. You can use the site without storage, but preferences and some examples will reset or stop persisting. Details in our Privacy Policy.