components

package
v1.7.4 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2026 License: GPL-2.0 Imports: 10 Imported by: 0

Documentation

Overview

templ: version: v0.3.1020

templ: version: v0.3.1020

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Button

func Button(config ButtonConfig) templ.Component

func ButtonDanger

func ButtonDanger(text string, icon any, hollow ...bool) templ.Component

func ButtonPrimary

func ButtonPrimary(text string, icon any, hollow ...bool) templ.Component

func ButtonSecondary

func ButtonSecondary(text string, icon any, hollow ...bool) templ.Component

func ButtonSuccess

func ButtonSuccess(text string, icon any, hollow ...bool) templ.Component

func ButtonWarning

func ButtonWarning(text string, icon any, hollow ...bool) templ.Component
func Header(lvel int, headingText, subText string, components ...templ.Component) templ.Component

func Heading

func Heading(level uint8, text string) templ.Component

func Heading1

func Heading1(text string) templ.Component

func Heading2

func Heading2(text string) templ.Component

func Heading3

func Heading3(text string) templ.Component

func Heading4

func Heading4(text string) templ.Component

func Heading5

func Heading5(text string) templ.Component

func Heading6

func Heading6(text string) templ.Component
func Link(config ButtonConfig, href func() string) templ.Component

func NewButton

func NewButton(text any, args ...interface{}) templ.Component

func NewShowableComponent added in v1.7.2

func NewShowableComponent(req *http.Request, isShown func(r *http.Request) bool, component templ.Component) *showableComponent

Types

type ButtonConfig

type ButtonConfig struct {
	Text  func(context.Context) string
	Icon  templ.Component
	Type  ClassType
	Attrs map[string]any
}

type ClassType added in v1.7.2

type ClassType uint8
const (
	ClassTypePrimary ClassType = 1 << iota
	ClassTypeSecondary
	ClassTypeSuccess
	ClassTypeInfo
	ClassTypeWarning
	ClassTypeDanger
	ClassTypeHollow
)

type ComponentList

type ComponentList[T Item] struct {
	// contains filtered or unexported fields
}

func (*ComponentList[T]) All

func (i *ComponentList[T]) All() []T

func (*ComponentList[T]) Append

func (i *ComponentList[T]) Append(item T)

func (*ComponentList[T]) Delete

func (i *ComponentList[T]) Delete(name string) (ok bool)

func (*ComponentList[T]) Get

func (i *ComponentList[T]) Get(name string) (T, bool)

type Item

type Item interface {
	Name() string
	Order() int
}

type Items

type Items[T Item] interface {
	All() []T
	Append(T)
	Get(name string) (T, bool)
	Delete(name string) (ok bool)
}

func NewItems

func NewItems[T Item]() Items[T]

type ShowableComponent added in v1.7.2

type ShowableComponent interface {
	IsShown() bool
	templ.Component
}

Directories

Path Synopsis
templ: version: v0.3.1020
templ: version: v0.3.1020
templ: version: v0.3.1020
templ: version: v0.3.1020

Jump to

Keyboard shortcuts

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