ā A collection of reusable UI components built with Golang's templ, TailwindCSS, Daisy UI, and Alpine.js.
util.go includes a helper GenerateUniqueKey. I used this dead simple helper to generate a unique ID for most all components.
func GenerateUniqueKey(id string) string {
return id + "-" + strconv.Itoa(rand.Intn(100000))
}
All components contain usage details for example here's input.templ:
/**
* Text Input Component.
* ======================
* This is a input component that can be used to create text inputs.
*
* @params InputProps
* @author: github.com/tego101 <-> x.com/tegodotdev
* @license: MIT
*
* Usage:
* @components.Input(components.InputProps{
* Type: "text",
* Name: "First Name",
* Placeholder: "Enter your name",
* Class: "max-w-6xl",
* HideLabel: true,
* })
*/
Some components may be unfinished. Contributions and pull requests are welcome to help complete them.
Include the desired component in your Golang templ file, and adjust the TailwindCSS classes and Alpine.js behavior as needed.
This project is licensed under the MIT License - see the LICENSE file for details.