props

package
v0.3.8 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FirstOrDefault added in v0.2.0

func FirstOrDefault[T any](def T, props ...T) T

Types

type Attrs

type Attrs struct {
	templ.Attributes
}

Attrs wraps templ.Attributes and adds helper functions With pattern is used for literal chaining, since the structs are small

func (Attrs) AsTemplAttrs

func (a Attrs) AsTemplAttrs() templ.Attributes

Returns templ attributes for html tags

func (Attrs) Merge

func (a Attrs) Merge(other Attrs) Attrs

Merge merges another Attrs into this one

func (Attrs) With

func (a Attrs) With(key, val string) Attrs

With sets given key attribute with string val

func (Attrs) WithClass

func (a Attrs) WithClass(class string) Attrs

WithClass sets or appends a class

func (Attrs) WithID

func (a Attrs) WithID(id string) Attrs

WithID sets the id attribute

func (Attrs) WithStyle added in v0.3.0

func (a Attrs) WithStyle(style string) Attrs

WithStyle sets or appends a style attribute

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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