utils

package
v0.25.0 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AlpineJS

func AlpineJS() templ.Component

Alpine returns script tags for Alpine.js

func MergeAttributes

func MergeAttributes(attrs ...templ.Attributes) templ.Attributes

mergeAttributes merges multiple Attributes into one

func RandomID

func RandomID() string

RandomID returns a random ID string Example: "id-123456"

func TwIf

func TwIf(class string, condition bool) string

TwIf returns a class if a condition is true, otherwise an empty string Example: "bg-red-500", true → "bg-red-500", false → ""

func TwMerge

func TwMerge(classes ...string) string

TwMerge combines Tailwind classes and handles conflicts. Later classes override earlier ones with the same base. Example: "bg-red-500 hover:bg-blue-500", "bg-green-500" → "hover:bg-blue-500 bg-green-500"

Types

This section is empty.

Jump to

Keyboard shortcuts

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