Forms

Switch

A checkbox presented as a labeled switch.

components.Switch · SwitchProps

Use it well.

It submits like a checkbox. Use for a boolean choice; this preview is not wired to a saved preference.

Explore the full demo →

This 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/TendUI/v2026/components"

templ ExampleSwitch() {
	@components.Switch(components.SwitchProps{ID: "sample-digest", Name: "digest", Label: "Include a weekly digest"})
}