Documentation ¶
Index ¶
- Constants
- Variables
- func Lazy(el string, attribs *Attributes, children ...Element) func() Element
- type Attributes
- func Attr(init string) *Attributes
- func Case(key string, m map[string]bool) *Attributes
- func Comp(key string, values []string) *Attributes
- func Flag(key string, cond bool) *Attributes
- func KV(kvs ...string) *Attributes
- func Maybe(key, value string, cond bool) *Attributes
- func Raw(key, value string, cond ...bool) *Attributes
- func Switch(key string, idx int, values []string) *Attributes
- func (attr *Attributes) Case(key string, m map[string]bool) *Attributes
- func (attr *Attributes) Comp(key string, values []string) *Attributes
- func (attr *Attributes) Flag(key string, cond bool) *Attributes
- func (attr *Attributes) KV(kvs ...string) *Attributes
- func (attr *Attributes) Maybe(key, value string, cond bool) *Attributes
- func (attr *Attributes) Raw(key, value string, cond ...bool) *Attributes
- func (attr *Attributes) String() string
- func (attr *Attributes) Switch(key string, idx int, values []string) *Attributes
- type Element
- func E(el string, attribs *Attributes, children ...Element) Element
- func Group(children ...Element) Element
- func If(cond bool, then Element, otherwise ...Element) Element
- func Map[S ~[]E, E any](s S, mfn func(E) Element) Element
- func Pack(children []Element) Element
- func Template(raw string, children ...Element) Element
- func Text(text string) Element
- func When(cond bool, then func() Element, otherwise ...func() Element) Element
Constants ¶
View Source
const SlotTag = "<|slot|>"
Variables ¶
View Source
var (
None = Element{}
)
Functions ¶
Types ¶
type Attributes ¶
type Attributes struct {
// contains filtered or unexported fields
}
func Attr ¶
func Attr(init string) *Attributes
func Comp ¶ added in v0.3.0
func Comp(key string, values []string) *Attributes
func Flag ¶ added in v0.3.0
func Flag(key string, cond bool) *Attributes
func KV ¶ added in v0.4.0
func KV(kvs ...string) *Attributes
func Maybe ¶ added in v0.4.0
func Maybe(key, value string, cond bool) *Attributes
func Raw ¶ added in v0.3.0
func Raw(key, value string, cond ...bool) *Attributes
func (*Attributes) Case ¶
func (attr *Attributes) Case(key string, m map[string]bool) *Attributes
func (*Attributes) Comp ¶ added in v0.3.0
func (attr *Attributes) Comp(key string, values []string) *Attributes
func (*Attributes) Flag ¶
func (attr *Attributes) Flag(key string, cond bool) *Attributes
func (*Attributes) KV ¶ added in v0.4.0
func (attr *Attributes) KV(kvs ...string) *Attributes
func (*Attributes) Maybe ¶ added in v0.4.0
func (attr *Attributes) Maybe(key, value string, cond bool) *Attributes
func (*Attributes) Raw ¶
func (attr *Attributes) Raw(key, value string, cond ...bool) *Attributes
func (*Attributes) String ¶
func (attr *Attributes) String() string
func (*Attributes) Switch ¶
func (attr *Attributes) Switch(key string, idx int, values []string) *Attributes
Click to show internal directories.
Click to hide internal directories.