form

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

View Source
var FieldsetVariants = uiutils.Variants{
	Base:     "grid gap-4",
	Keys:     []string{"variant", "size"},
	Defaults: map[string]string{"variant": "default", "size": "default"},
	ByKey: map[string]map[string]string{
		"variant": {
			"default":  "",
			"card":     "rounded-md border border-border p-4",
			"inline":   "flex flex-wrap items-start gap-3",
			"unstyled": "",
		},
		"size": {
			"sm":      "gap-2",
			"default": "gap-4",
			"lg":      "gap-6",
		},
	},
}
View Source
var LegendVariants = uiutils.Variants{
	Base:     "text-sm font-medium",
	Keys:     []string{"variant", "size"},
	Defaults: map[string]string{"variant": "default", "size": "default"},
	ByKey: map[string]map[string]string{
		"variant": {
			"default":  "",
			"muted":    "text-muted-foreground",
			"unstyled": "",
		},
		"size": {
			"sm":      "text-xs",
			"default": "text-sm",
			"lg":      "text-base",
		},
	},
}
View Source
var MeterVariants = uiutils.Variants{
	Base:     "h-2 w-full",
	Keys:     []string{"variant", "size"},
	Defaults: map[string]string{"variant": "default", "size": "default"},
	ByKey: map[string]map[string]string{
		"variant": {
			"default":  "accent-primary",
			"muted":    "accent-muted-foreground",
			"unstyled": "",
		},
		"size": {
			"sm":      "h-1",
			"default": "h-2",
			"lg":      "h-3",
		},
	},
}
View Source
var ProgressVariants = uiutils.Variants{
	Base:     "h-2 w-full",
	Keys:     []string{"variant", "size"},
	Defaults: map[string]string{"variant": "default", "size": "default"},
	ByKey: map[string]map[string]string{
		"variant": {
			"default":  "accent-primary",
			"muted":    "accent-muted-foreground",
			"unstyled": "",
		},
		"size": {
			"sm":      "h-1",
			"default": "h-2",
			"lg":      "h-3",
		},
	},
}

Functions

func DataList

func DataList(p DataListProps) templ.Component

DataList renders native datalist.

func DataOption

func DataOption(p DataOptionProps) templ.Component

DataOption renders an option inside datalist.

func Fieldset

func Fieldset(p FieldsetProps) templ.Component

Fieldset renders native fieldset.

func FieldsetClasses

func FieldsetClasses(p FieldsetProps) string

func Form

func Form(p FormProps) templ.Component

Form renders a vertical grid form container.

func FormDescription

func FormDescription(p FormDescriptionProps, value string) templ.Component

FormDescription renders muted helper copy below a control.

func FormItem

func FormItem(p FormItemProps) templ.Component

FormItem groups a single field with spacing for label and control.

func FormMessage

func FormMessage(p FormMessageProps, value string) templ.Component

FormMessage renders destructive validation feedback.

func Legend

func Legend(p LegendProps) templ.Component

Legend renders native legend.

func LegendClasses

func LegendClasses(p LegendProps) string

func Meter

func Meter(p MeterProps) templ.Component

Meter renders native meter.

func MeterClasses

func MeterClasses(p MeterProps) string

func Output

func Output(p OutputProps) templ.Component

Output renders native output.

func Progress

func Progress(p ProgressProps) templ.Component

Progress renders native progress.

func ProgressClasses

func ProgressClasses(p ProgressProps) string

Types

type DataListProps

type DataListProps struct {
	ID    string
	Class string
	Attrs templ.Attributes
}

DataListProps configures datalist.

type DataOptionProps

type DataOptionProps struct {
	Value string
	Label string
	Attrs templ.Attributes
}

DataOptionProps configures option inside datalist.

type FieldsetProps

type FieldsetProps struct {
	Variant  string
	Size     string
	Class    string
	Name     string
	Form     string
	Disabled bool
	Attrs    templ.Attributes
}

FieldsetProps configures a fieldset group.

type FormDescriptionProps

type FormDescriptionProps struct {
	Class string
}

FormDescriptionProps styles supplementary field hint text.

type FormItemProps

type FormItemProps struct {
	Class string
}

FormItemProps wraps one label + control + helper text group.

type FormMessageProps

type FormMessageProps struct {
	Class string
}

FormMessageProps styles validation or error text (role=alert).

type FormProps

type FormProps struct {
	ID           string
	Class        string
	Action       string
	Method       string
	Enctype      string
	Autocomplete string
	Name         string
	Target       string
	NoValidate   bool
	Attrs        templ.Attributes
}

FormProps configures the native form element.

type LegendProps

type LegendProps struct {
	Variant string
	Size    string
	Class   string
	Attrs   templ.Attributes
}

LegendProps configures a legend.

type MeterProps

type MeterProps struct {
	Variant string
	Size    string
	ID      string
	Class   string
	Value   string
	Min     string
	Max     string
	Low     string
	High    string
	Optimum string
	Attrs   templ.Attributes
}

MeterProps configures meter.

type OutputProps

type OutputProps struct {
	ID    string
	Class string
	Name  string
	For   string
	Value string
	Attrs templ.Attributes
}

OutputProps configures output.

type ProgressProps

type ProgressProps struct {
	Variant string
	Size    string
	ID      string
	Class   string
	Value   string
	Max     string
	Attrs   templ.Attributes
}

ProgressProps configures progress.

Jump to

Keyboard shortcuts

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