element

package
v0.248.1 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2026 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ELOption added in v0.246.0

type ELOption struct {
	// contains filtered or unexported fields
}

func NewELOption added in v0.246.0

func NewELOption(display, value string, options ...ELOptionOption) *ELOption

func (*ELOption) Template added in v0.246.0

func (o *ELOption) Template() templ.Component

type ELOptionOption added in v0.246.0

type ELOptionOption func(*ELOption)

func WithELOptionProperties added in v0.246.0

func WithELOptionProperties(options ...PropertiesOption) ELOptionOption

func WithELOptionSelected added in v0.246.0

func WithELOptionSelected(value bool) ELOptionOption

type ELSelect added in v0.246.0

type ELSelect struct {
	// contains filtered or unexported fields
}

func NewELSelect added in v0.246.0

func NewELSelect(id, name string, options ...ELSelectOption) *ELSelect

func (*ELSelect) GetSelected added in v0.246.0

func (s *ELSelect) GetSelected() *ELOption

func (*ELSelect) Template added in v0.246.0

func (s *ELSelect) Template() templ.Component

type ELSelectOption added in v0.246.0

type ELSelectOption func(*ELSelect)

func WithELSelectLabel added in v0.246.0

func WithELSelectLabel(label string) ELSelectOption

func WithELSelectOptions added in v0.246.0

func WithELSelectOptions(options ...*ELOption) ELSelectOption

type Img added in v0.173.0

type Img struct {
	Src    string
	Alt    string
	Width  int
	Height int
	// contains filtered or unexported fields
}

func NewImg added in v0.173.0

func NewImg(src, alt string, width, height int, options ...PropertiesOption) *Img

func (*Img) Template added in v0.173.0

func (i *Img) Template() templ.Component
type MenuItem struct {
	// contains filtered or unexported fields
}

func NewMenuItem added in v0.246.0

func NewMenuItem(text string, options ...MenuItemOption) *MenuItem
func (i *MenuItem) Template() templ.Component
type MenuItemOption func(*MenuItem)

func WithMenuItemProperties added in v0.246.0

func WithMenuItemProperties(options ...PropertiesOption) MenuItemOption

func WithMenuItemSelected added in v0.246.0

func WithMenuItemSelected(value bool) MenuItemOption

type Properties added in v0.98.0

type Properties struct {
	// contains filtered or unexported fields
}

Properties represents properties of an element, including its attributes and classes.

func NewProperties added in v0.98.0

func NewProperties(options ...PropertiesOption) *Properties

NewProperties creates a Properties object for an element with the given options.

func (*Properties) GetAllAttributes added in v0.246.0

func (p *Properties) GetAllAttributes() templ.Attributes

GetAllAttributes returns the attributes as a templ.Attributes.

func (*Properties) GetClasses added in v0.246.0

func (p *Properties) GetClasses() string

GetClasses returns the classes as a string.

func (*Properties) GetID added in v0.246.0

func (p *Properties) GetID() string

GetID returns the value of the "id" attribute. If there is no id attribute, an empty string is returned.

func (*Properties) HasAttribute added in v0.98.0

func (p *Properties) HasAttribute(key string) bool

HasAttribute returns a boolean indicating whether there is an attribute with the given key.

func (*Properties) SetAttribute added in v0.98.0

func (p *Properties) SetAttribute(key string, value any)

SetAttribute sets an attribute with the given key to the given value. Any existing value is overridden.

func (*Properties) SetClasses added in v0.246.0

func (p *Properties) SetClasses(classes ...string)

type PropertiesOption added in v0.98.0

type PropertiesOption func(*Properties)

PropertiesOption is a functional option to set Properties.

func WithAttribute

func WithAttribute(key string, value any) PropertiesOption

WithAttribute option sets a key-value attribute on the properties. Any existing value is overridden.

func WithAttributes

func WithAttributes(attributes templ.Attributes) PropertiesOption

WithAttributes option merges the given attributes with any existing attributes.

func WithClasses

func WithClasses(classes ...string) PropertiesOption

WithClasses option sets the classes on the properties. New values are merged with existing values and any duplicates removed.

func WithHXIndicator added in v0.180.0

func WithHXIndicator(indicator string) PropertiesOption

WithHXIndicator sets a "hx-indicator" attribute.

func WithHXMethod added in v0.100.0

func WithHXMethod(method, value string) PropertiesOption

WithHXMethod sets a "hx-{get,post,put,delete}" attribute.

func WithHXParams added in v0.100.0

func WithHXParams(params string) PropertiesOption

WithHXParams sets a "hx-params" attribute.

func WithHXPushURL added in v0.108.0

func WithHXPushURL(value bool) PropertiesOption

WithHXPushURL sets a "hx-push-url" attribute.

func WithHXReplaceURL added in v0.246.0

func WithHXReplaceURL(value bool) PropertiesOption

WithHXReplaceURL sets a "hx-replace-url" attribute.

func WithHXSwap added in v0.108.0

func WithHXSwap(swap string) PropertiesOption

WithHXSwap sets a "hx-swap" attribute.

func WithHXSwapOOB added in v0.138.0

func WithHXSwapOOB(swap string) PropertiesOption

WithHXSwapOOB sets a "hx-swap-oob" attribute.

func WithHXTarget added in v0.100.0

func WithHXTarget(target string) PropertiesOption

WithHXTarget sets a "hx-target" attribute.

func WithHXTrigger added in v0.159.0

func WithHXTrigger(trigger string) PropertiesOption

WithHXTrigger sets a "hx-trigger" attribute.

func WithHXValues added in v0.100.0

func WithHXValues(values any) PropertiesOption

WithHXValues sets a "hx-vals" attribute. Note that the given map is marshaled to JSON and any marshaling error will silently result in no attribute being set.

Jump to

Keyboard shortcuts

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