Forms
FileInput
A labeled native file chooser.
components.FileInput · FileInputProps
Preview
Open standalone preview →This preview does not upload anything. Accept is a browser hint, not server validation.
Use it well.
Accept filters the picker as a hint. It is not MIME validation or an upload service. The component preview performs no upload; the CSV demo shows bounded Go validation without saving files.
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/TendUI/v2026/components"
templ ExampleFileInput() {
@components.FileInput(components.FileInputProps{ID: "sample-file", Name: "attachment", Label: "Choose a local text file", Accept: ".txt", DescribedBy: "sample-file-help"})
<small id="sample-file-help">This preview does not upload anything. Accept is a browser hint, not server validation.</small>
}