selectfield

package
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 12, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OptGroup

func OptGroup(p OptGroupProps) templ.Component

OptGroup renders a native optgroup around option children.

func Select

func Select(p SelectProps) templ.Component

Select renders option children from Options slice.

func SelectClasses

func SelectClasses(p SelectProps) string

func SelectOption

func SelectOption(p OptionProps) templ.Component

SelectOption renders an option for custom Select children.

Types

type OptGroupProps

type OptGroupProps struct {
	Class    string
	Label    string
	Disabled bool
	Attrs    templ.Attributes
}

OptGroupProps configures a native optgroup.

type Option

type Option struct {
	Value string
	Label string
}

Option is one select choice.

type OptionProps

type OptionProps struct {
	Value    string
	Label    string
	Selected bool
	Disabled bool
	Attrs    templ.Attributes
}

OptionProps configures a slot-based option.

type SelectProps

type SelectProps struct {
	Variant string
	Size    string
	Class   string
	Name    string
	// Value — currently selected option value
	Value     string
	Disabled  bool
	Required  bool
	Options   []Option
	ID        string
	Role      string
	TabIndex  string
	AriaLabel string
	Attrs     templ.Attributes
}

SelectProps configures a native select element.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL