Forms

Form

Native GET/POST submission with optional HTMX hooks.

components.Form · FormProps

Use it well.

Action and Method remain functional without scripts. Multipart enables encoding only; the application must bound and validate file uploads.

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 ExampleForm() {
	@components.Form(components.FormProps{Action: "/catalog", Method: components.MethodGet}) {
		@components.Input(components.InputProps{Name: "q", Label: "Find a component", Type: components.InputSearch, Placeholder: "Try card"})
		@components.Button(components.ButtonProps{Text: "Search catalog", Type: components.ButtonTypeSubmit})
	}
}