Actions
ThemeToggle
A native POST form for changing the color mode.
components.ThemeToggle · ThemeToggleProps
Preview
Open standalone preview →Use it well.
Place outside other forms. Supply your application's endpoint, cookies and CSRF policy; this demo already has the handler. The optional HTMX response redirects to a cleaned same-origin URL.
Explore the full demo →Templ example
Download example.templThis is the source compiled for the preview. Select the text to copy it, or download the file. Change the package name and demo routes for your application.
package examples
import "github.com/Tend-Stack/GothUI/v2026/components"
templ ExampleThemeToggle() {
@components.ThemeToggle(components.ThemeToggleProps{Label: "Change color mode"})
}