templwind

module
v0.0.0-...-8b46cda Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2025 License: MIT

README

Templwind

Convenient and accessible Templ components for Go developers.

Features
  • Accessibility
  • CSP compatible
  • Configurability
  • A library of additional helper functions
  • Looks kinda somewhat decent

Usage

Installation

go get github.com/dimmerz92/templwind

Example

In a Templ file

package components

import "github.com/dimmerz92/templwind/twui"

templ MyComponent() {
  // ... surrounding content
  @twui.Alert(ui.Alert{Theme: themes.Warning})
  // ... surrounding content
}

In a Go file

package main

import (
  "net/http"

  "github.com/dimmerz92/templwind/twlib"
  "github.com/dimmerz92/templwind/twui"
)

func main() {
	http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
		twlib.Render(w, r, 200, twui.Alert())
	})

  log.Fatal(http.ListenAndServe(":8000", nil))
}

Planned Components

Actions
Containers (Active)
  • Accordion
  • Carousel
  • DataTable
  • Dropdown Menu
  • Hover Card
  • Sheet
  • Toast
Containers (Passive)
  • Alert
  • Avatar
  • Badge
  • Card
  • Scrollable
  • Table
Content
Form Controls
Navigation
  • Breadcrumb
  • Nav Menu
  • Sidebar
  • Tabs

Contributing

  • For a small change, just send a PR.
  • For bigger changes open an issue for discussion before sending a PR.
  • PR should have:
    • Documentation
    • Example (If it makes sense)
  • You can also contribute by:
    • Reporting issues
    • Suggesting new features or enhancements
    • Improve/fix documentation

License

This project is licensed under the MIT license.

Directories

Path Synopsis
templ: version: v0.3.819
templ: version: v0.3.819
pkg
twicons
templ: version: v0.3.819
templ: version: v0.3.819
twui
templ: version: v0.3.819
templ: version: v0.3.819

Jump to

Keyboard shortcuts

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