Documentation
¶
Overview ¶
templui util templui.go - version: main installed by templui v0.70.0
Index ¶
- Constants
- func If[T comparable](condition bool, value T) T
- func IfElse[T any](condition bool, trueValue T, falseValue T) T
- func IsEmptyValue(d string) bool
- func IsOverwritableMethod(method string) bool
- func IsPathStyles(path, expected, trueStyles, falseStyles string) string
- func MergeAttributes(attrs ...templ.Attributes) templ.Attributes
- func RandomID() string
- func TwMerge(classes ...string) string
Constants ¶
View Source
const UuidV4Pattern = "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
Variables ¶
This section is empty.
Functions ¶
func If ¶
func If[T comparable](condition bool, value T) T
TwIf returns value if condition is true, otherwise an empty value of type T. Example: true, "bg-red-500" → "bg-red-500"
func IfElse ¶
TwIfElse returns trueValue if condition is true, otherwise falseValue. Example: true, "bg-red-500", "bg-gray-300" → "bg-red-500"
func IsEmptyValue ¶ added in v0.24.0
func IsOverwritableMethod ¶
func IsPathStyles ¶
func MergeAttributes ¶
func MergeAttributes(attrs ...templ.Attributes) templ.Attributes
MergeAttributes combines multiple Attributes into one. Example: MergeAttributes(attr1, attr2) → combined attributes
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.