uiForm

package
v0.2.8 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2026 License: MIT Imports: 10 Imported by: 1

README

Form

Form layer of Infinite UI. It collects user input: text, choices, and switches. Every component binds to Alpine.js state; field components render their label as a floating legend. Part of Infinite UI.

Every labelled form component accepts TextCase with a uiToolset.TextCase* value: TextCaseNone (the default, as typed), TextCaseLower, TextCaseUpper, or TextCaseCapitalize. It transforms the label, and the placeholder where the component renders one.

CheckboxInput

Checkbox with a label, bound to a boolean or an array state path.

@uiForm.CheckboxInput(uiForm.CheckboxInputSettings{
    Label:           "Accept the terms",
    TwoWayStatePath: "hasAcceptedTerms",

    // OptionalFields
    InputName: "hasAcceptedTerms",
    Shape:     uiToolset.ShapeRounded,
})

Shape accepts uiToolset.ShapeSquare, uiToolset.ShapeRounded (the default), and uiToolset.ShapeCircular. Size accepts the CheckboxInputSize* constants. CheckedColor, UncheckedColor, and FocusRingColor set the box colors; the box border previews CheckedColor on hover. LabelPosition accepts CheckboxInputLabelPositionLeft and CheckboxInputLabelPositionRight. IsChecked, IsDisabled, and IsRequired render static states. IsCheckedOneWayStatePath, IsDisabledOneWayStatePath, and IndeterminateOneWayStatePath bind them to Alpine state. AriaLabel names the checkbox when no visible label is present.

IsInvalid and IsInvalidOneWayStatePath flag the error state. The box border turns to ErrorColor (default "red-500"), and the input carries aria-invalid. ErrorMessage and ErrorMessageOneWayStatePath render the message below the control. With InputId set, the input links to it through aria-describedby. When an invalid path is set, the message shows only while the path is true.

InputField

Single-line input with a floating label, optional affixes, and an optional hint.

@uiForm.InputField(uiForm.InputFieldSettings{
    InputType:       uiForm.InputTypeText,
    InputName:       "name",
    Label:           "Name",
    TwoWayStatePath: "name",
    IsRequired:      true,
})

InputType accepts the uiForm.InputType* constants. IconLeft takes a Phosphor icon class and renders it inside the field before the input, for example "ph-magnifying-glass". An affix renders a static value (AffixLeftValue, AffixRightValue) or binds a state path (AffixLeftStatePath, AffixRightStatePath). Set AffixLeftWidthPercent or AffixRightWidthPercent to fix an affix to a percentage of the field width, for example 25 or 50. AffixRightComponent renders any templ component at the right edge, after the right affix. PasswordInput uses it for its action buttons. InputTypeExpression supplies the type from an Alpine expression and overrides InputType at runtime, for example "isPasswordVisible ? 'text' : 'password'". Number inputs accept InputNumberMin, InputNumberMax, and InputNumberStep. Size accepts the InputFieldSize* constants and defaults to md. It scales the input, the affixes, and the floating label together. TextCase accepts a uiToolset.TextCase* value. It transforms the floating label and the placeholder. The default, TextCaseNone, leaves the text as typed.

PasswordInput

Password field with a reveal toggle, an optional random password generator, and an optional strength meter. It composes InputField, so every InputField setting travels through.

@uiForm.PasswordInput(uiForm.PasswordInputSettings{
    InputName:       "password",
    Label:           "Password",
    TwoWayStatePath: "password",

    // OptionalFields
    ShouldShowGenerateButton: true,
    ShouldShowStrengthMeter:  true,
})

Rules configures the generator and the meter: MinLength (default 6), MaxLength (default 64), GenerationLength (default 16), and one ShouldInclude*Chars flag per character class. When no class is selected, every class is required. The generator runs on UiToolset.CreateRandomPassword(options) and guarantees at least one character from each selected class. The meter shows a percentage bar and a criteria checklist that updates as the user types; the checklist shows only the enabled criteria. The generate button copies the new password to the clipboard and shows a success toast. The toast text follows the browser language and falls back to English; the page must mount Toast. The reveal and generate buttons each render through uiControl.Button as a fixed square sized to the field, with a tooltip and an accessible name. ActionButtonStyle accepts PasswordInputActionButtonStyleBoxed (the default) or PasswordInputActionButtonStylePlain for bare icons. StrengthMeterColor, StrengthCriteriaTextColor, StrengthCriteriaFulfilledIconColor, and StrengthCriteriaUnfulfilledIconColor take a color token and repaint the meter bar, the checklist text, and the fulfilled and unfulfilled icons.

InlineCheckboxGroup

A row or column of checkboxes under one shared label. The label notches into the top border of the field, matching InlineRadioGroup and the other notched fields.

@uiForm.InlineCheckboxGroup(uiForm.InlineCheckboxGroupSettings{
    Label: "Fruits",
    InputSettings: []uiForm.CheckboxInputSettings{
        {Label: "Apple", Value: "apple", TwoWayStatePath: "selectedFruits", InputName: "selectedFruits"},
        {Label: "Banana", Value: "banana", TwoWayStatePath: "selectedFruits", InputName: "selectedFruits"},
    },
})

Each CheckboxInputSettings carries its own size, shape, colors, and errors. When the shared state path holds an array, Alpine adds and removes the checked values. All inputs must share the same array TwoWayStatePath; the select-all and deselect-all actions write it, and select-all skips statically disabled options. Orientation accepts InlineCheckboxGroupOrientationHorizontal (the default) and InlineCheckboxGroupOrientationVertical. MaxVisibleOptions caps the visible option rows and scrolls the rest. TextCase transforms only the shared label. The group reveals select-all and deselect-all FloatingButton actions on hover or focus. FloatingButtonStyle repaints them and changes their size and shape; ShouldHideFloatingButtons removes them.

FloatingButton

Small icon button that floats over a field and reveals on hover or focus. InlineCheckboxGroup and TextArea render their actions with it.

@uiForm.FloatingButton(uiForm.FloatingButtonSettings{
    AriaLabel:   "Clear text area content",
    Icon:        "ph-x-circle",
    OnClickFunc: "description = ''",
})

Icon renders a static icon; IconOneWayStatePath binds the icon to Alpine state. Style accepts a FloatingButtonStyle with BackgroundColor, BackgroundColorActive, BackgroundColorHover, RingColor, RingColorHover, TextColor, TextColorHover, Size, and Shape. Every field falls back to the neutral default.

TextArea

Multiline input with expand, copy, and clear actions.

@uiForm.TextArea(uiForm.TextAreaSettings{
    Label:           "Description",
    TwoWayStatePath: "description",
})

Set IsCode for monospace text. IsReadOnly sets the native readonly attribute. IsRequired adds the required marker to the label. The field reveals expand, copy, and clear FloatingButton actions on hover or focus. FloatingButtonStyle repaints them and changes their size and shape; ShouldHideFloatingButtons removes them and lets the text use the full width.

SelectInput

Dropdown select. It is not a native <select>: screen-reader-only radio inputs and an Alpine-driven list carry the value. Three option modes exist:

  1. FlatOptions []string for plain values.
  2. LabelValueOptions []SelectLabelValueOption for label and value pairs.
  3. LabelValueOptions with LabelHtml for rich option content.
@uiForm.SelectInput(uiForm.SelectInputSettings{
    InputName:       "status",
    Label:           "Status",
    FlatOptions:     []string{"running", "stopped"},
    TwoWayStatePath: "status",
})

IsMultiSelect renders checkbox rows, keeps the dropdown open after each toggle, and binds an array on TwoWayStatePath; the trigger joins the selected labels. InputId prefixes the option checkbox ids in multi mode. ShouldIncludeBlankOption adds a blank entry in single mode; multi mode shows the clear control whenever the array holds a value. IsDisabledOneWayStatePath disables the trigger while the path is truthy. OnChangeFunc runs after a change, a toggle, or a clear. Size accepts the SelectInputSize* constants and defaults to md. DropdownMinHeightClass and DropdownMaxHeightClass cap the list height (default max-h-60). MaxVisibleOptions caps it to a row count and wins over both.

SearchableSelectInput

Dropdown with a filter box. Typing narrows the local options in place. The list caps its height and scrolls. A clear button empties the selection. Use it past roughly ten options, where a native select becomes hard to scan.

@uiForm.SearchableSelectInput(uiForm.SearchableSelectInputSettings{
    InputName:       "country",
    Label:           "Country",
    FlatOptions:     []string{"Argentina", "Brazil", "Chile"},
    TwoWayStatePath: "country",
})

It shares the FlatOptions and LabelValueOptions modes with SelectInput. The filter matches the label, case-insensitively. IsMultiSelect binds an array and keeps the dropdown open after each toggle. SelectionDisplay accepts SearchableSelectInputSelectionDisplayText (the default) or SearchableSelectInputSelectionDisplayTags for removable tags inside the field. The text display joins the selected labels. With tags, ShouldAllowCustomValues turns a typed value into a tag on Enter, and Backspace on an empty input removes the last tag. Each tag shows the option label while the bound array holds the stored value. Tags apply to multi mode only. TagOuterBackgroundColor (default secondary-500) paints the tag and its border, TagOuterTextColor (default neutral-50) paints its text, and TagInnerBackgroundColor (default neutral-50/10) paints the label bubble. DropdownMinHeightClass and DropdownMaxHeightClass cap the list (default max-h-60). MaxVisibleOptions caps it to a row count and wins over both. OnChangeFunc runs on selection, on a multi-select toggle, on a tag change, and on clear. Single mode writes one hidden input. Multi mode writes one hidden input per selected value, so a form submission carries every value under InputName.

RemoteSearchableSelectInput

Searchable select whose options come from a URL as the user types. It debounces the requests and waits for the minimum query length. It discards stale responses and shows loading, empty, and error states.

@uiForm.RemoteSearchableSelectInput(uiForm.RemoteSearchableSelectInputSettings{
    InputName:       "country",
    Label:           "Country",
    OptionsUrl:      "/api/countries/search",
    TwoWayStatePath: "country",
})

OptionsQueryParam names the query parameter (default q). MinQueryLength gates the first request (default 3). DebounceMs waits before each request (default 300). Below the minimum query length, including an empty query, the dropdown shows the minimum-length prompt. DropdownMinHeightClass, DropdownMaxHeightClass, and MaxVisibleOptions size the list like the local variant. The endpoint receives GET OptionsUrl?<query param>=<typed text>. It returns { "body": [{ "label": "...", "value": "..." }] }. A bare JSON array of strings or {label, value} objects also works. IsMultiSelect binds an array and caches the selected labels while the query changes. InitialOptions preloads label-value pairs for values already bound to the state, so the trigger shows their labels and the dropdown lists them until the user types; a fetched option wins for the same value. OnChangeFunc runs on selection, on a multi-select toggle, and on clear.

RadioInput

Single radio option. Group several inputs by sharing one TwoWayStatePath.

@uiForm.RadioInput(uiForm.RadioInputSettings{
    Label:           "Option 1",
    StateValue:      "option1",
    TwoWayStatePath: "selectedOption",
})

InlineRadioGroup

A row of radios with one shared label. The label notches into the top border of the field, matching InputField, SelectInput, and the other notched fields.

@uiForm.InlineRadioGroup(uiForm.InlineRadioGroupSettings{
    Label: "Select an option",
    InputSettings: []uiForm.RadioInputSettings{
        {Label: "Option 1", StateValue: "option1", TwoWayStatePath: "groupSelection"},
        {Label: "Option 2", StateValue: "option2", TwoWayStatePath: "groupSelection"},
    },
})

Orientation accepts InlineRadioGroupOrientationHorizontal (the default) and InlineRadioGroupOrientationVertical. MaxVisibleOptions caps the visible option rows and scrolls the rest. InlineRadioGroup's TextCase transforms only the shared label. Each option label takes its own RadioInputSettings.TextCase.

ToggleSwitch

Boolean switch. Bind one state path, or set CustomValue to collect one value into an array state path.

@uiForm.ToggleSwitch(uiForm.ToggleSwitchSettings{
    Label:           "Enable notifications",
    TwoWayStatePath: "isNotificationsEnabled",
})

LabelPosition accepts ToggleSwitchLabelPositionLeft and ToggleSwitchLabelPositionRight. The *Color settings override the track and thumb colors.

InputHint

Shared hint helper for the fields above. It renders no field of its own.

  • HintDisplay accepts InputHintDisplayTooltip for an icon with a tooltip, or InputHintDisplayDescription for a line below the field.
  • HintValue carries static text; HintStatePath binds live text.
  • HintDisplayTooltipMinWidthClass, HintDisplayTooltipMaxWidthClass, HintDisplayTooltipMinHeightClass, and HintDisplayTooltipMaxHeightClass cap the hint tooltip on every field that offers hints. HintDisplayTooltipBackgroundColor paints it.
  • The tooltip display renders through the shared uiToolset tooltip, so it teleports to the document body and a scroll container or a modal cannot clip it.
  • InputHintTooltip and InputHintDescription can also render directly, when a hint sits next to custom markup.

Non-obvious behaviors

  • SelectInput renders a templ.JSONScript block for label-value options. The block feeds the selected label lookup and the multi-select summary.
  • SearchableSelectInput and RemoteSearchableSelectInput render one templ.JSONScript config block and share one Alpine state, searchableSelectInput. The config carries the normalized options, the multi-select and custom-value flags, and the remote settings.
  • The floating legend collapses while the field is empty, so the empty field shows the label as a placeholder.
  • InputField hides its empty legend with display: none. Chrome reserves scroll space for a zero-sized legend, so the opacity-based collapse the other field components use can phantom-scroll an overflow container.
  • A dropdown opens upward when the space below the trigger cannot hold it. The space stops at the viewport and at every clipping ancestor on both sides; when neither side fits, the dropdown opens on the side with more space, so the list never opens downward into an overflow-hidden panel such as the carousel surface. UiToolset.SelectDropdown.openUpwardResolver makes the decision for SelectInput and the searchable fields.
  • UiToolset.CreateRandomPassword accepts an options object: length, minLength, maxLength, and one include* flag per character class. With no arguments it keeps the original 16-character behavior.
  • InputName sets the key in an HTMX form submission. InputId is optional.

Documentation

Overview

templ: version: v0.3.1070

templ: version: v0.3.1070

templ: version: v0.3.1070

templ: version: v0.3.1070

templ: version: v0.3.1070

templ: version: v0.3.1070

templ: version: v0.3.1070

templ: version: v0.3.1070

templ: version: v0.3.1070

templ: version: v0.3.1070

templ: version: v0.3.1070

templ: version: v0.3.1070

templ: version: v0.3.1070

Index

Constants

View Source
const (
	CheckboxInputSizeXs string = "xs"
	CheckboxInputSizeSm string = "sm"
	CheckboxInputSizeMd string = "md"
	CheckboxInputSizeLg string = "lg"
	CheckboxInputSizeXl string = "xl"

	CheckboxInputLabelPositionLeft  string = "left"
	CheckboxInputLabelPositionRight string = "right"
)
View Source
const (
	InlineCheckboxGroupOrientationHorizontal string = inlineGroupOrientationHorizontal
	InlineCheckboxGroupOrientationVertical   string = inlineGroupOrientationVertical
)
View Source
const (
	InlineRadioGroupOrientationHorizontal string = inlineGroupOrientationHorizontal
	InlineRadioGroupOrientationVertical   string = inlineGroupOrientationVertical
)
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"

	InputFieldSizeXs string = "xs"
	InputFieldSizeSm string = "sm"
	InputFieldSizeMd string = "md"
	InputFieldSizeLg string = "lg"
	InputFieldSizeXl string = "xl"
)
View Source
const (
	InputHintDisplayTooltip     string = "tooltip"
	InputHintDisplayDescription string = "description"

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

	InputHintIconStylePlain string = "plain"
	InputHintIconStyleBoxed string = "boxed"
)
View Source
const (
	PasswordInputActionButtonStyleBoxed string = "boxed"
	PasswordInputActionButtonStylePlain string = "plain"
)
View Source
const (
	RadioInputSizeXs string = "xs"
	RadioInputSizeSm string = "sm"
	RadioInputSizeMd string = "md"
	RadioInputSizeLg string = "lg"
	RadioInputSizeXl string = "xl"
)
View Source
const (
	SearchableSelectInputSelectionDisplayText string = "text"
	SearchableSelectInputSelectionDisplayTags string = "tags"
)
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 CheckboxInput added in v0.2.1

func CheckboxInput(componentSettings CheckboxInputSettings) templ.Component

func FloatingButton added in v0.2.7

func FloatingButton(componentSettings FloatingButtonSettings) templ.Component

func InlineCheckboxGroup added in v0.2.6

func InlineCheckboxGroup(componentSettings InlineCheckboxGroupSettings) templ.Component

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 PasswordInput added in v0.2.6

func PasswordInput(componentSettings PasswordInputSettings) templ.Component

func RadioInput

func RadioInput(componentSettings RadioInputSettings) templ.Component

func RemoteSearchableSelectInput added in v0.2.6

func RemoteSearchableSelectInput(componentSettings RemoteSearchableSelectInputSettings) templ.Component

func SearchableSelectInput added in v0.2.6

func SearchableSelectInput(componentSettings SearchableSelectInputSettings) 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 CheckboxInputSettings added in v0.2.1

type CheckboxInputSettings struct {
	// OptionalFields
	AriaLabel                    string
	CheckedColor                 string
	ErrorColor                   string
	ErrorMessage                 string
	ErrorMessageOneWayStatePath  string
	FocusRingColor               string
	IndeterminateOneWayStatePath string
	InputId                      string
	InputName                    string
	IsChecked                    bool
	IsCheckedOneWayStatePath     string
	IsDisabled                   bool
	IsDisabledOneWayStatePath    string
	IsFullWidth                  bool
	IsInvalid                    bool
	IsInvalidOneWayStatePath     string
	IsRequired                   bool
	Label                        string
	LabelPosition                string
	OnChangeFunc                 string
	Shape                        string
	Size                         string
	TextCase                     string
	TextColor                    string
	TwoWayStatePath              string
	UncheckedColor               string
	Value                        string
}

type FloatingButtonSettings added in v0.2.7

type FloatingButtonSettings struct {
	AriaLabel   string
	OnClickFunc string

	// OptionalFields
	Icon                string
	IconOneWayStatePath string
	Style               FloatingButtonStyle
}

type FloatingButtonStyle added in v0.2.7

type FloatingButtonStyle struct {
	// OptionalFields
	BackgroundColor       string
	BackgroundColorActive string
	BackgroundColorHover  string
	RingColor             string
	RingColorHover        string
	TextColor             string
	TextColorHover        string
	Size                  string
	Shape                 string
}

type InlineCheckboxGroupSettings added in v0.2.6

type InlineCheckboxGroupSettings struct {
	Label         string
	InputSettings []CheckboxInputSettings

	// OptionalFields
	Orientation               string
	MaxVisibleOptions         uint
	TextCase                  string
	FloatingButtonStyle       FloatingButtonStyle
	ShouldHideFloatingButtons bool
}

type InlineRadioGroupSettings

type InlineRadioGroupSettings struct {
	Label         string
	InputSettings []RadioInputSettings

	// OptionalFields
	Orientation       string
	MaxVisibleOptions uint
	TwoWayStatePath   string
	InputId           string
	InputName         string
	TextCase          string
}

type InputFieldSettings

type InputFieldSettings struct {
	InputType string
	InputName string
	Label     string

	// OptionalFields
	TwoWayStatePath                   string
	Value                             string
	AffixLeftValue                    string
	AffixLeftStatePath                string
	AffixLeftWidthPercent             uint
	AffixRightValue                   string
	AffixRightStatePath               string
	AffixRightWidthPercent            uint
	AffixRightComponent               templ.Component
	IconLeft                          string
	InputId                           string
	InputTypeExpression               string
	InputNumberMin                    string
	InputNumberMax                    string
	InputNumberStep                   string
	IsRequired                        bool
	IsReadOnly                        bool
	TextCase                          string
	HintValue                         string
	HintStatePath                     string
	HintDisplay                       string
	HintDisplayTooltipBackgroundColor string
	HintDisplayTooltipMinWidthClass   string
	HintDisplayTooltipMaxWidthClass   string
	HintDisplayTooltipMinHeightClass  string
	HintDisplayTooltipMaxHeightClass  string
	HintIconStyle                     string
	Size                              string
}

type InputHintSettings added in v0.2.0

type InputHintSettings struct {
	Value                  string
	StatePath              string
	TooltipBackgroundColor string
	Size                   string
	IconStyle              string
	TooltipMinWidthClass   string
	TooltipMaxWidthClass   string
	TooltipMinHeightClass  string
	TooltipMaxHeightClass  string
}

type PasswordInputRules added in v0.2.6

type PasswordInputRules struct {
	MinLength                   uint
	MaxLength                   uint
	GenerationLength            uint
	ShouldIncludeLowercaseChars bool
	ShouldIncludeUppercaseChars bool
	ShouldIncludeNumbers        bool
	ShouldIncludeSpecialChars   bool
}

type PasswordInputSettings added in v0.2.6

type PasswordInputSettings struct {
	InputName       string
	Label           string
	TwoWayStatePath string

	// OptionalFields
	Rules                                PasswordInputRules
	Value                                string
	Size                                 string
	TextCase                             string
	ActionButtonStyle                    string
	IsRequired                           bool
	IsReadOnly                           bool
	ShouldShowGenerateButton             bool
	ShouldShowStrengthMeter              bool
	StrengthMeterColor                   string
	StrengthCriteriaTextColor            string
	StrengthCriteriaFulfilledIconColor   string
	StrengthCriteriaUnfulfilledIconColor string
	HintValue                            string
	HintStatePath                        string
	HintDisplay                          string
	HintDisplayTooltipBackgroundColor    string
	HintDisplayTooltipMinWidthClass      string
	HintDisplayTooltipMaxWidthClass      string
	HintDisplayTooltipMinHeightClass     string
	HintDisplayTooltipMaxHeightClass     string
	HintIconStyle                        string
}

type RadioInputSettings

type RadioInputSettings struct {
	Label           string
	StateValue      string
	TwoWayStatePath string

	// OptionalFields
	InputId   string
	InputName string
	Size      string
	TextCase  string
}

type RemoteSearchableSelectInputSettings added in v0.2.6

type RemoteSearchableSelectInputSettings struct {
	InputName  string
	Label      string
	OptionsUrl string

	// OptionalFields
	OptionsQueryParam                 string
	MinQueryLength                    uint
	DebounceMs                        uint
	TwoWayStatePath                   string
	InputId                           string
	IsMultiSelect                     bool
	InitialOptions                    []SelectLabelValueOption
	OnChangeFunc                      string
	Size                              string
	TextCase                          string
	DropdownBackgroundColor           string
	DropdownMinHeightClass            string
	DropdownMaxHeightClass            string
	MaxVisibleOptions                 uint
	IsDisabledOneWayStatePath         string
	HintValue                         string
	HintStatePath                     string
	HintDisplay                       string
	HintDisplayTooltipBackgroundColor string
	HintDisplayTooltipMinWidthClass   string
	HintDisplayTooltipMaxWidthClass   string
	HintDisplayTooltipMinHeightClass  string
	HintDisplayTooltipMaxHeightClass  string
	HintIconStyle                     string
}

type SearchableSelectInputSettings added in v0.2.6

type SearchableSelectInputSettings struct {
	InputName string
	Label     string

	// OptionalFields
	FlatOptions                       []string
	LabelValueOptions                 []SelectLabelValueOption
	TwoWayStatePath                   string
	InputId                           string
	IsMultiSelect                     bool
	SelectionDisplay                  string
	ShouldAllowCustomValues           bool
	TagOuterBackgroundColor           string
	TagOuterTextColor                 string
	TagInnerBackgroundColor           string
	OnChangeFunc                      string
	Size                              string
	TextCase                          string
	DropdownBackgroundColor           string
	DropdownMinHeightClass            string
	DropdownMaxHeightClass            string
	MaxVisibleOptions                 uint
	IsDisabledOneWayStatePath         string
	HintValue                         string
	HintStatePath                     string
	HintDisplay                       string
	HintDisplayTooltipBackgroundColor string
	HintDisplayTooltipMinWidthClass   string
	HintDisplayTooltipMaxWidthClass   string
	HintDisplayTooltipMinHeightClass  string
	HintDisplayTooltipMaxHeightClass  string
	HintIconStyle                     string
}

type SelectInputSettings

type SelectInputSettings struct {
	InputName string
	Label     string

	// OptionalFields
	FlatOptions                       []string
	LabelValueOptions                 []SelectLabelValueOption
	TwoWayStatePath                   string
	InputId                           string
	IsMultiSelect                     bool
	OnChangeFunc                      string
	Size                              string
	TextCase                          string
	DropdownBackgroundColor           string
	DropdownMinHeightClass            string
	DropdownMaxHeightClass            string
	MaxVisibleOptions                 uint
	IsDisabledOneWayStatePath         string
	IsRequired                        bool
	ShouldIncludeBlankOption          bool
	HintValue                         string
	HintStatePath                     string
	HintDisplay                       string
	HintDisplayTooltipBackgroundColor string
	HintDisplayTooltipMinWidthClass   string
	HintDisplayTooltipMaxWidthClass   string
	HintDisplayTooltipMinHeightClass  string
	HintDisplayTooltipMaxHeightClass  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
	TextCase                          string
	TwoWayStatePath                   string
	Value                             string
	IsCode                            bool
	IsReadOnly                        bool
	IsRequired                        bool
	FloatingButtonStyle               FloatingButtonStyle
	ShouldHideFloatingButtons         bool
	HintValue                         string
	HintStatePath                     string
	HintDisplay                       string
	HintDisplayTooltipBackgroundColor string
	HintDisplayTooltipMinWidthClass   string
	HintDisplayTooltipMaxWidthClass   string
	HintDisplayTooltipMinHeightClass  string
	HintDisplayTooltipMaxHeightClass  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
	TextCase                    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