uiForm

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2026 License: MIT Imports: 6 Imported by: 1

Documentation

Overview

templ: version: v0.3.1020

templ: version: v0.3.1020

templ: version: v0.3.1020

templ: version: v0.3.1020

templ: version: v0.3.1020

templ: version: v0.3.1020

templ: version: v0.3.1020

templ: version: v0.3.1020

Index

Constants

View Source
const (
	InputTypeColor    string = "color"
	InputTypeDate     string = "date"
	InputTypeEmail    string = "email"
	InputTypeHidden   string = "hidden"
	InputTypeMonth    string = "month"
	InputTypeNumber   string = "number"
	InputTypePassword string = "password"
	InputTypeTel      string = "tel"
	InputTypeText     string = "text"
	InputTypeTime     string = "time"
	InputTypeUrl      string = "url"
)
View Source
const (
	InputHintDisplayTooltip     string = "tooltip"
	InputHintDisplayDescription string = "description"

	InputHintSizeSm string = "sm"
	InputHintSizeLg string = "lg"

	InputHintIconStylePlain string = "plain"
	InputHintIconStyleBoxed string = "boxed"
)
View Source
const (
	RadioInputSizeXs string = "xs"
	RadioInputSizeSm string = "sm"
	RadioInputSizeMd string = "md"
	RadioInputSizeLg string = "lg"
	RadioInputSizeXl string = "xl"
)
View Source
const (
	SelectInputSizeXs string = "xs"
	SelectInputSizeSm string = "sm"
	SelectInputSizeMd string = "md"
	SelectInputSizeLg string = "lg"
	SelectInputSizeXl string = "xl"
)
View Source
const (
	TextAreaSizeXs = "xs"
	TextAreaSizeSm = "sm"
	TextAreaSizeMd = "md"
	TextAreaSizeLg = "lg"
	TextAreaSizeXl = "xl"
)
View Source
const (
	ToggleSwitchLabelPositionLeft  string = "left"
	ToggleSwitchLabelPositionRight string = "right"
	ToggleSwitchSizeXs             string = "xs"
	ToggleSwitchSizeSm             string = "sm"
	ToggleSwitchSizeMd             string = "md"
	ToggleSwitchSizeLg             string = "lg"
	ToggleSwitchSizeXl             string = "xl"
)

Variables

This section is empty.

Functions

func InlineRadioGroup

func InlineRadioGroup(componentSettings InlineRadioGroupSettings) templ.Component

func InputField

func InputField(componentSettings InputFieldSettings) templ.Component

func InputHintDescription added in v0.2.0

func InputHintDescription(componentSettings InputHintSettings) templ.Component

func InputHintTooltip added in v0.2.0

func InputHintTooltip(componentSettings InputHintSettings) templ.Component

func MultiSelectInput added in v0.1.7

func MultiSelectInput(componentSettings MultiSelectInputSettings) templ.Component

func RadioInput

func RadioInput(componentSettings RadioInputSettings) templ.Component

func SelectInput

func SelectInput(componentSettings SelectInputSettings) templ.Component

func TextArea

func TextArea(componentSettings TextAreaSettings) templ.Component

func ToggleSwitch added in v0.1.8

func ToggleSwitch(componentSettings ToggleSwitchSettings) templ.Component

ToggleSwitch supports two Alpine.js binding modes:

Boolean mode: Set TwoWayStatePath to a boolean property and leave CustomValue empty. Example: x-data="{enabled: false}", TwoWayStatePath: "enabled".

Array mode: Set TwoWayStatePath to an array property and set CustomValue to one item. Alpine.js adds the value when checked and removes it when unchecked. Render one switch for each item, using the same path and a different value. Example: x-data="{channels: ['email']}", TwoWayStatePath: "channels", CustomValue: "sms".

Set InputName to include the bound state in form submission.

Types

type InlineRadioGroupSettings

type InlineRadioGroupSettings struct {
	Label         string
	InputSettings []RadioInputSettings

	// OptionalFields
	TwoWayStatePath string
	InputId         string
	InputName       string
}

type InputFieldSettings

type InputFieldSettings struct {
	InputType string
	InputName string
	Label     string

	// OptionalFields
	TwoWayStatePath                   string
	Value                             string
	AffixLeftValue                    string
	AffixLeftStatePath                string
	AffixRightValue                   string
	AffixRightStatePath               string
	InputId                           string
	InputNumberMin                    string
	InputNumberMax                    string
	InputNumberStep                   string
	IsRequired                        bool
	IsReadOnly                        bool
	HintValue                         string
	HintStatePath                     string
	HintDisplay                       string
	HintDisplayTooltipBackgroundColor string
	HintIconStyle                     string
}

type InputHintSettings added in v0.2.0

type InputHintSettings struct {
	Value                  string
	StatePath              string
	TooltipBackgroundColor string
	Size                   string
	IconStyle              string
}

type MultiSelectInputSettings added in v0.1.7

type MultiSelectInputSettings struct {
	InputName string
	Label     string

	// OptionalFields
	FlatOptions                       []string
	LabelValueOptions                 []SelectLabelValueOption
	TwoWayStatePath                   string
	InputId                           string
	IsRequired                        bool
	DropdownBackgroundColor           string
	HintValue                         string
	HintStatePath                     string
	HintDisplay                       string
	HintDisplayTooltipBackgroundColor string
	HintIconStyle                     string
}

type RadioInputSettings

type RadioInputSettings struct {
	Label           string
	StateValue      string
	TwoWayStatePath string

	// OptionalFields
	InputId   string
	InputName string
	Size      string
}

type SelectInputSettings

type SelectInputSettings struct {
	InputName string
	Label     string

	// OptionalFields
	FlatOptions                       []string
	LabelValueOptions                 []SelectLabelValueOption
	TwoWayStatePath                   string
	OnChangeFunc                      string
	Size                              string
	DropdownBackgroundColor           string
	IsRequired                        bool
	ShouldIncludeBlankOption          bool
	HintValue                         string
	HintStatePath                     string
	HintDisplay                       string
	HintDisplayTooltipBackgroundColor string
	HintIconStyle                     string
}

type SelectLabelValueOption

type SelectLabelValueOption struct {
	Label     string          `json:"label"`
	LabelHtml templ.Component `json:"-"`
	Value     string          `json:"value"`
}

type TextAreaSettings

type TextAreaSettings struct {
	Label string

	// OptionalFields
	InputId                           string
	InputName                         string
	Size                              string
	TwoWayStatePath                   string
	Value                             string
	IsCode                            bool
	IsReadOnly                        bool
	IsRequired                        bool
	HintValue                         string
	HintStatePath                     string
	HintDisplay                       string
	HintDisplayTooltipBackgroundColor string
}

type ToggleSwitchSettings added in v0.1.8

type ToggleSwitchSettings struct {
	Label           string
	TwoWayStatePath string

	// OptionalFields
	CustomValue                 string
	FocusRingColor              string
	InputId                     string
	InputName                   string
	IsDisabled                  bool
	IsRequired                  bool
	LabelPosition               string
	Size                        string
	TextColor                   string
	ThumbBackgroundColor        string
	ThumbBorderColor            string
	TrackBackgroundColor        string
	TrackCheckedBackgroundColor string
}

Jump to

Keyboard shortcuts

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