components

package
v1.21.0 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

templ: version: v0.3.1001

templ: version: v0.3.1001

templ: version: v0.3.1001

templ: version: v0.3.1001

templ: version: v0.3.1001

templ: version: v0.3.1001

templ: version: v0.3.1001

templ: version: v0.3.1001

templ: version: v0.3.1001

templ: version: v0.3.1001

templ: version: v0.3.1001

templ: version: v0.3.1001

templ: version: v0.3.1001

templ: version: v0.3.1001

templ: version: v0.3.1001

templ: version: v0.3.1001

templ: version: v0.3.1001

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Badge

func Badge(props BadgeProps) templ.Component

func Button

func Button(props ButtonProps) templ.Component

func Card

func Card(props CardProps) templ.Component

func Checkbox

func Checkbox(props CheckboxProps) templ.Component

func CurrencyAmount

func CurrencyAmount(props CurrencyAmountProps) templ.Component

func Drawer

func Drawer(props DrawerProps) templ.Component

func EmptyState

func EmptyState(props EmptyStateProps) templ.Component

func FormField

func FormField(props FormFieldProps) templ.Component

func Input

func Input(props InputProps) templ.Component
func Modal(props ModalProps) templ.Component
func PageHeader(props PageHeaderProps) templ.Component

func Select

func Select(props SelectProps) templ.Component

func Skeleton

func Skeleton(props SkeletonProps) templ.Component

func Spinner

func Spinner(props SpinnerProps) templ.Component

func Table

func Table(props TableProps) templ.Component

func Textarea

func Textarea(props TextareaProps) templ.Component

func Toast

func Toast(props ToastProps) templ.Component

Types

type BadgeProps

type BadgeProps struct {
	Label   string
	Variant BadgeVariant
	Size    BadgeSize
	Class   string
}

type BadgeSize

type BadgeSize string
const (
	BadgeSm BadgeSize = "sm"
	BadgeMd BadgeSize = "md"
)

type BadgeVariant

type BadgeVariant string
const (
	BadgeSuccess BadgeVariant = "success"
	BadgeDanger  BadgeVariant = "danger"
	BadgeWarning BadgeVariant = "warning"
	BadgeInfo    BadgeVariant = "info"
	BadgeNeutral BadgeVariant = "neutral"
)

type ButtonProps

type ButtonProps struct {
	Label    string
	Variant  ButtonVariant
	Size     ButtonSize
	Type     ButtonType
	Loading  bool
	Disabled bool
	Class    string
	Attrs    templ.Attributes // used for hx-*, form, etc
}

type ButtonSize

type ButtonSize string
const (
	ButtonSm ButtonSize = "sm"
	ButtonMd ButtonSize = "md"
	ButtonLg ButtonSize = "lg"
)

type ButtonType

type ButtonType string
const (
	ButtonTypeButton ButtonType = "button"
	ButtonTypeSubmit ButtonType = "submit"
	ButtonTypeReset  ButtonType = "reset"
)

type ButtonVariant

type ButtonVariant string
const (
	ButtonPrimary   ButtonVariant = "primary"
	ButtonSecondary ButtonVariant = "secondary"
	ButtonGhost     ButtonVariant = "ghost"
	ButtonDanger    ButtonVariant = "danger"
)

type CardPadding

type CardPadding string
const (
	CardPaddingNone CardPadding = "none"
	CardPaddingSm   CardPadding = "sm"
	CardPaddingMd   CardPadding = "md"
	CardPaddingLg   CardPadding = "lg"
)

type CardProps

type CardProps struct {
	Header  templ.Component
	Footer  templ.Component
	Padding CardPadding
	Class   string
}

type CheckboxProps

type CheckboxProps struct {
	ID          string
	Name        string
	Label       string
	Description string
	Checked     bool
	Required    bool
	Disabled    bool
	Error       string
	Class       string
	Attrs       templ.Attributes
}

type CurrencyAmountProps

type CurrencyAmountProps struct {
	Cents        int64
	CurrencyCode string // "BRL", "USD"
	ShowSign     bool
	Class        string
}

type DrawerProps

type DrawerProps struct {
	ID      string
	Title   string
	Size    DrawerSize
	Content templ.Component
	Footer  templ.Component
}

type DrawerSize

type DrawerSize string
const (
	DrawerSizeSm DrawerSize = "sm"
	DrawerSizeMd DrawerSize = "md"
	DrawerSizeLg DrawerSize = "lg"
	DrawerSizeXl DrawerSize = "xl"
)

type EmptyStateProps

type EmptyStateProps struct {
	Icon        templ.Component
	Title       string
	Description string
	Actions     templ.Component
	Class       string
}

type FormFieldProps

type FormFieldProps struct {
	ID       string // Shared with Input/Select/etc
	Label    string
	Hint     string
	Error    string
	Required bool
	Content  templ.Component // Input/Select/Checkbox component goes here
	Class    string
}

type InputProps

type InputProps struct {
	ID           string
	Name         string
	Type         InputType
	Value        string
	Placeholder  string
	Required     bool
	Disabled     bool
	Error        string
	Class        string
	Autocomplete string
	Inputmode    string
	Maxlength    int
	Attrs        templ.Attributes
}

type InputType

type InputType string
const (
	InputTypeText     InputType = "text"
	InputTypeEmail    InputType = "email"
	InputTypeNumber   InputType = "number"
	InputTypePassword InputType = "password"
	InputTypeDate     InputType = "date"
	InputTypeSearch   InputType = "search"
	InputTypeTel      InputType = "tel"
	InputTypeUrl      InputType = "url"
)

type ModalProps

type ModalProps struct {
	ID      string
	Title   string
	Size    ModalSize
	Content templ.Component
	Footer  templ.Component
	OnClose string // Alpine JS code to run when closed
}

type ModalSize

type ModalSize string
const (
	ModalSizeSm ModalSize = "sm"
	ModalSizeMd ModalSize = "md"
	ModalSizeLg ModalSize = "lg"
	ModalSizeXl ModalSize = "xl"
)

type PageHeaderProps

type PageHeaderProps struct {
	Title    string
	Subtitle string
	Actions  templ.Component
	Class    string
}

type SelectOption

type SelectOption struct {
	Label    string
	Value    string
	Selected bool
	Disabled bool
}

type SelectProps

type SelectProps struct {
	ID          string
	Name        string
	Options     []SelectOption
	Placeholder string
	Required    bool
	Disabled    bool
	Error       string
	Class       string
	Attrs       templ.Attributes
}

type SkeletonProps

type SkeletonProps struct {
	Shape SkeletonShape
	Class string // used to set height/width
}

type SkeletonShape

type SkeletonShape string
const (
	SkeletonRect   SkeletonShape = "rect"
	SkeletonCircle SkeletonShape = "circle"
)

type SpinnerProps

type SpinnerProps struct {
	Size  string // "sm", "md", "lg"
	Class string
}

type TableProps

type TableProps struct {
	ID         string
	Zebra      bool
	Compact    bool
	Sticky     bool
	EmptySlot  templ.Component
	HeaderSlot templ.Component
	BodySlot   templ.Component
	FooterSlot templ.Component
	Class      string
}

type TextareaProps

type TextareaProps struct {
	ID          string
	Name        string
	Value       string
	Placeholder string
	Required    bool
	Disabled    bool
	Rows        int
	Maxlength   int
	Error       string
	Class       string
	Attrs       templ.Attributes
}

type ToastProps

type ToastProps struct {
	ID      string
	Variant ToastVariant
	Title   string
	Message string
}

type ToastVariant

type ToastVariant string
const (
	ToastSuccess ToastVariant = "success"
	ToastError   ToastVariant = "error"
	ToastWarning ToastVariant = "warning"
	ToastInfo    ToastVariant = "info"
)

Jump to

Keyboard shortcuts

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