templdais

package module
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2024 License: MIT Imports: 5 Imported by: 4

README

TemplDais

Templ Components maded with Tailwind and DaisyUI, for easy use.

Badges

GitHub Tag GitHub Repo stars GitHub commit activity

Features

  • Components ready to use.
  • Includes Types as Links, Attributes and more.
  • Color and size customizable.

Installation

Install the UI with go get

  go get github.com/henrriusdev/templdais

Demo

// /path/to/your/file.templ

package templdais

templ Page() {
    <div class="w-full h-full flex justify-center items-center">
    @Button("primary", "button", "sm", "circle"){
        This works!
    }
}

Here, the arguments are:

  1. The value primary is for the brand color.
  2. The value button is for the HTML Tag.
  3. sm is the size.
  4. circle is the shape of the button, can be square or circle.

Roadmap

DaisyUI Components ported to TemplDais:

Added 2024/04/14
  • Button
  • Dropdown
  • Modal
  • Kbd
  • Breadcrumbs
  • Checkbox
  • Radio
  • Accordion
  • Badge
  • Card (responsive card for now)
Added 2024/04/15
  • Table
  • Navbar
  • Pagination
  • Toast
  • File Input
  • Range
  • Select
  • Text input
  • Textarea
  • Code
Added 2024/04/19
  • Alert
  • Divider
  • Menu
Added 2024/04/27
  • Bottom navigation
  • Progress
  • Tooltip

Comming soon:

  • A Documentation web of TemplDais is incoming soon (in development)
  • I've plained to use or create a Icons Kit for TemplDais, for now, you must provide the url of the icons (svg)

And next (not my priority):

  • Chat bubble
  • Toggle
  • Drawer
  • Collapse
  • Stat
  • Avatar
  • Advanced pagination

Not implementable (yet):

  • Countdown & Radial Progress (sorry, templ doesn´t allows dynamic style attribute for set --value css variable)
  • Tab (it needs a tabs and tabpanel, maybe in a long future I'll work on this)
  • Timeline (for now, it includes many features that I can´t do it myself yet)
  • Indicator (it is a section with a badge... implement yourself)

Acknowledgements

Authors

Documentation

Overview

templ: version: v0.2.747

templ: version: v0.2.747

templ: version: v0.2.747

templ: version: v0.2.747

templ: version: v0.2.747

templ: version: v0.2.747

templ: version: v0.2.747

templ: version: v0.2.747

templ: version: v0.2.747

templ: version: v0.2.747

templ: version: v0.2.747

templ: version: v0.2.747

templ: version: v0.2.747

templ: version: v0.2.747

templ: version: v0.2.747

templ: version: v0.2.747

templ: version: v0.2.747

templ: version: v0.2.747

templ: version: v0.2.747

templ: version: v0.2.747

templ: version: v0.2.747

templ: version: v0.2.747

templ: version: v0.2.747

templ: version: v0.2.747

templ: version: v0.2.747

templ: version: v0.2.747

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Accordion

func Accordion(acc AccordionAttrs) templ.Component

func Alert

func Alert(art AlertAttrs) templ.Component

func Badge

func Badge(bdg BadgeAttrs) templ.Component

func BottomNav

func BottomNav(attrs BottomNavAttrs) templ.Component
func Breadcrumbs(textSize string, items []Links) templ.Component

func Button

func Button(btn ButtonAttrs, attrs templ.Attributes) templ.Component

func Card

func Card(cd CardAttrs, btn ButtonAttrs) templ.Component

func Checkbox

func Checkbox(chk FormAttrs) templ.Component

func Code

func Code(cd CodeAttrs) templ.Component

func Divider

func Divider(dv DividerAttrs) templ.Component
func DropdownMenu(attrs DropdownAttrs) templ.Component

func FileInput

func FileInput(fi FormAttrs, attrs templ.Attributes) templ.Component

func GetBrandColorClass

func GetBrandColorClass(prefix, brand string) string

func GetShapeClass

func GetShapeClass(prefix, shape string) string

func GetSizeClass

func GetSizeClass(prefix, size string) string

func Kbd

func Kbd(size string, text string) templ.Component
func Menu(m MenuAttrs) templ.Component
func Modal(modal ModalAttrs, btn ButtonAttrs, attrs templ.Attributes) templ.Component
func Navbar(nb NavbarAttrs) templ.Component

func Pagination

func Pagination(pg PaginationAttrs, btn ButtonAttrs) templ.Component

func Progress

func Progress(p ProgressAttrs) templ.Component

func Radio

func Radio(rdo FormAttrs) templ.Component

func Range

func Range(rng RangeAttrs, attrs templ.Attributes) templ.Component
func RenderLinks(items []Links, submenuItems map[string][]Links) templ.Component

func Select

func Select(fms FormAttrs, attrs templ.Attributes) templ.Component

func SetActive added in v1.7.0

func SetActive(index int) templ.ComponentScript

func Table

func Table(tb TableAttrs) templ.Component

func TextArea

func TextArea(fma FormAttrs, attrs templ.Attributes) templ.Component

func TextField

func TextField(fmt FormAttrs, attrs templ.Attributes) templ.Component

func Toast

func Toast(tst ToastAttrs) templ.Component

func Tooltip

func Tooltip(a TooltipAttrs) templ.Component

Types

type AccordionAttrs

type AccordionAttrs struct {
	Items     []AccordionItem
	Name      string
	Class     string
	Arrow     bool
	PlusMinus bool
}

func (*AccordionAttrs) GetClassName

func (acc *AccordionAttrs) GetClassName() string

type AccordionItem

type AccordionItem struct {
	Title   string
	Content templ.Component
	Open    bool
	Class   string
}

func (AccordionItem) GetClassName

func (acc AccordionItem) GetClassName() string

type AlertAttrs

type AlertAttrs struct {
	Brand       string
	Buttons     bool
	Class       string
	Text        string
	Description string
}

func (AlertAttrs) GetClassName

func (a AlertAttrs) GetClassName() string

type BadgeAttrs

type BadgeAttrs struct {
	Brand   string
	Outline bool
	Size    string
	Text    string
	Class   string
}

func (BadgeAttrs) GetClassName

func (bdg BadgeAttrs) GetClassName() string

type BottomNavAttrs

type BottomNavAttrs struct {
	Size  string
	Brand string
	Items []BtmNavItem
	Class string
}

func (BottomNavAttrs) GetClassName

func (btm BottomNavAttrs) GetClassName() string

type BtmNavItem

type BtmNavItem struct {
	Body   templ.Component
	Button ButtonAttrs
	Attrs  templ.Attributes
	Active bool
}

func (BtmNavItem) GetClassName added in v1.5.6

func (item BtmNavItem) GetClassName(brand string) string

type ButtonAttrs

type ButtonAttrs struct {
	Type    string
	Brand   string
	Figure  string
	Size    string
	Class   string
	Outline bool
	Active  bool
	Link    templ.SafeURL
	Click   templ.ComponentScript
}

func (ButtonAttrs) GetClassName

func (btn ButtonAttrs) GetClassName() string

func (ButtonAttrs) SetActive

func (btn ButtonAttrs) SetActive() ButtonAttrs
func (btn ButtonAttrs) SetLink(link templ.SafeURL) ButtonAttrs

type CardAttrs

type CardAttrs struct {
	Title       string
	Description string
	Image       string
	ButtonText  string
	Class       string
}

type CodeAttrs

type CodeAttrs struct {
	Prefix string
	Brand  string
	Text   string
	Class  string

	LineCode []LineCode
}

type DividerAttrs

type DividerAttrs struct {
	Brand    string
	Vertical bool
	Start    bool
	End      bool
	Text     string
	Class    string
}

func (DividerAttrs) GetClassName

func (div DividerAttrs) GetClassName() string
type DropdownAttrs struct {
	Position string
	Items    []Links
	End      bool
	Hover    bool
	Class    string
	BtnBrand string
	BtnSize  string
}
func (attrs *DropdownAttrs) GetClassName() string

type FormAttrs

type FormAttrs struct {
	FieldName     string
	FieldID       string
	FieldBrand    string
	FieldSize     string
	FieldBordered bool
	FieldDisabled bool
	FieldGhost    bool
	Checked       string
	Class         string
	Options       Options
	Placeholder   string
}

func (FormAttrs) GetClassName

func (f FormAttrs) GetClassName(prefix string) string

type LineCode

type LineCode struct {
	Text   string
	Prefix string
	Brand  string
	Size   string
	Class  string
}

func (LineCode) GetClassName

func (code LineCode) GetClassName() string
type Links struct {
	Text string
	Href templ.SafeURL
}
type MenuAttrs struct {
	Size       string
	Responsive bool
	Vertical   bool
	Items      []MenuItem
	Class      string
}
func (m MenuAttrs) GetClass() string
type MenuItem struct {
	Text     string
	Link     templ.SafeURL
	Class    string
	Disabled bool
}
func (m MenuItem) GetClass() string

type ModalAttrs

type ModalAttrs struct {
	Position string
	ID       string
	Open     bool
	Class    string
	BoxClass string
}

func (ModalAttrs) GetClassName

func (m ModalAttrs) GetClassName() string
type NavbarAttrs struct {
	Brand        string
	Items        []Links
	Title        string
	TitleOnly    bool
	Submenu      bool
	SubmenuItems map[string][]Links
	Search       bool
	Responsive   bool
	Centered     bool
	Class        string
	BodyClass    string
}
func (nb NavbarAttrs) GetClassName() string

type Options

type Options interface{}

type OptsString

type OptsString []string

type OptsStruct

type OptsStruct struct {
	Text  string
	Value string
}

type PaginationAttrs

type PaginationAttrs struct {
	Total       int
	PagesToShow int
	CurrentPage int
	LastPage    int
	NextPageUrl string
	PrevPageUrl string
}

type ProgressAttrs

type ProgressAttrs struct {
	Progress      string // max is always 100
	Class         string
	Brand         string
	Indeterminate bool
}

func (ProgressAttrs) GetProgress

func (p ProgressAttrs) GetProgress() string

type RangeAttrs

type RangeAttrs struct {
	ID   string
	Name string

	// style
	Brand string
	Size  string
	Class string
}

func (RangeAttrs) GetClassname

func (rng RangeAttrs) GetClassname() string

type TableAttrs

type TableAttrs struct {
	TableName  string
	Columns    []string
	PrimaryKey string
	Rows       []map[string]string
	Zebra      bool
	PinColumns bool
	PinRows    bool
	Size       string
	Class      string
}

func (TableAttrs) GetTableClass

func (t TableAttrs) GetTableClass() string

type ToastAttrs

type ToastAttrs struct {
	Msg                string
	Brand              string
	VerticalPosition   string
	HorizontalPosition string
	Class              string
}

func (ToastAttrs) GetClassName

func (tst ToastAttrs) GetClassName() string

type TooltipAttrs

type TooltipAttrs struct {
	Content  string
	Brand    string
	Position string
	Class    string
	Open     bool
	// contains filtered or unexported fields
}

func (TooltipAttrs) GetClassName

func (a TooltipAttrs) GetClassName() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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