ui

package
v0.0.0-...-e4c263e Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

templ: version: v0.2.778

templ: version: v0.2.778

templ: version: v0.2.778

templ: version: v0.2.778

templ: version: v0.2.778

templ: version: v0.2.778

templ: version: v0.2.778

templ: version: v0.2.778

templ: version: v0.2.778

templ: version: v0.2.778

templ: version: v0.2.778

templ: version: v0.2.778

templ: version: v0.2.778

templ: version: v0.2.778

templ: version: v0.2.778

templ: version: v0.2.778

templ: version: v0.2.778

templ: version: v0.2.778

templ: version: v0.2.778

templ: version: v0.2.778

templ: version: v0.2.778

Index

Constants

View Source
const (
	BadgeVariantDefault = iota
	BadgeVariantSecondary
	BadgeVariantDestructive
	BadgeVariantOutline
)
View Source
const (
	BadgeBaseClass = "" /* 164-byte string literal not displayed */
)

Variables

View Source
var CollapsibleTriggerAttrs = templ.Attributes{
	"x-data":         true,
	"x-on:click":     "shadcntempl_open = ! shadcntempl_open",
	":aria-expanded": "shadcntempl_open",
	":data-state":    "shadcntempl_open ? 'open' : 'closed'",
	":data-disabled": "shadcntempl_disabled",
}

There is no element for collapsible trigger, just add these attributes to your component.

View Source
var DefaultCoreProps = CoreProps{
	// contains filtered or unexported fields
}
View Source
var DialogCloseAttrs = templ.Attributes{
	"x-on:click": "shadcntempl_open = false",
}

If you want to add a custom close, add this attributes to your component

View Source
var DialogTriggerAttrs = templ.Attributes{
	"aria-haspopup":  "dialog",
	":aria-expanded": "shadcntempl_open",
	"x-data":         true,
	"x-on:click":     "shadcntempl_open = true",
}

There is no element for dialog trigger, just add these attributes to your component.

View Source
var DropdownMenuTriggerAttrs = templ.Attributes{
	"x-on:mousedown":             "open = true",
	"aria-haspopup":              "menu",
	":aria-expanded":             "open",
	"x-data":                     true,
	"x-on:keydown.enter.prevent": "open = true",
	"x-on:keydown.space.prevent": "open = true",
	"x-on:keydown.down.prevent":  "open = true",
}

There is no element for dropdown menu trigger, just add these attributes to your component.

Functions

func Accordion

func Accordion(classes string, attrs templ.Attributes) templ.Component

func AccordionItem

func AccordionItem(classes string, attrs templ.Attributes) templ.Component

func AccordionTrigger

func AccordionTrigger(classes string, attrs templ.Attributes) templ.Component

func AccorionContent

func AccorionContent(classes string, attrs templ.Attributes) templ.Component

func Alert

func Alert(variant AlertVariant, classes string, attrs templ.Attributes) templ.Component

func AlertDescription

func AlertDescription(classes string, attrs templ.Attributes) templ.Component

func AlertTitle

func AlertTitle(classes string, attrs templ.Attributes) templ.Component

func Avatar

func Avatar(classes string, attrs templ.Attributes) templ.Component

func AvatarFallback

func AvatarFallback(classes string, attrs templ.Attributes) templ.Component

func AvatarImage

func AvatarImage(src, alt, classes string, attrs templ.Attributes) templ.Component

func Badge

func Badge(variant BadgeVariant, classes string, attrs templ.Attributes) templ.Component
func Breadcrumb(classes string, attrs templ.Attributes) templ.Component
func BreadcrumbItem(classes string, attrs templ.Attributes) templ.Component
func BreadcrumbLink(href templ.SafeURL, classes string, attrs templ.Attributes) templ.Component
func BreadcrumbList(classes string, attrs templ.Attributes) templ.Component
func BreadcrumbSeparator(classes string, attrs templ.Attributes) templ.Component

func Button

func Button(buttonType ButtonType, variant ButtonVariant, size ButtonSize, classes string, attrs templ.Attributes) templ.Component

func Card

func Card(classes string, attrs templ.Attributes) templ.Component

func CardContent

func CardContent(classes string, attrs templ.Attributes) templ.Component

func CardDescription

func CardDescription(classes string, attrs templ.Attributes) templ.Component

func CardFooter

func CardFooter(classes string, attrs templ.Attributes) templ.Component

func CardHeader

func CardHeader(classes string, attrs templ.Attributes) templ.Component

func CardTitle

func CardTitle(classes string, attrs templ.Attributes) templ.Component

func Checkbox

func Checkbox(name, classes string, attrs templ.Attributes) templ.Component

`attrs` will go to the inner input

func Collapsible

func Collapsible(defaultOpen bool, classes string, attrs templ.Attributes) templ.Component

func CollapsibleContent

func CollapsibleContent(classes string, attrs templ.Attributes) templ.Component

func Dialog

func Dialog(classes string, attrs templ.Attributes) templ.Component

func DialogContent

func DialogContent(classes string, attrs templ.Attributes) templ.Component

func DialogDescription

func DialogDescription(classes string, attrs templ.Attributes) templ.Component

func DialogFooter

func DialogFooter(classes string, attrs templ.Attributes) templ.Component

func DialogHeader

func DialogHeader(classes string, attrs templ.Attributes) templ.Component

func DialogTitle

func DialogTitle(classes string, attrs templ.Attributes) templ.Component
func DropdownMenu(classes string, attrs templ.Attributes) templ.Component
func DropdownMenuContent(align DropdownMenuAlign, classes string, attrs templ.Attributes) templ.Component
func DropdownMenuItem(classes string, attrs templ.Attributes) templ.Component
func DropdownMenuLabel(classes string, attrs templ.Attributes) templ.Component
func DropdownMenuSeparator(classes string, attrs templ.Attributes) templ.Component
func DropdownMenuShortcut(classes string, attrs templ.Attributes) templ.Component

func Field

func Field(classes string, attrs templ.Attributes) templ.Component

func FieldDescription

func FieldDescription(classes string, attrs templ.Attributes) templ.Component

func FieldError

func FieldError(id, classes string, attrs templ.Attributes) templ.Component

`id` is for hx-swap-oob, if not needed, set it to an empty string (i.e., "")

func Input

func Input(name string, inputType InputType, classes string, attrs templ.Attributes) templ.Component

func Label

func Label(classes string, attrs templ.Attributes) templ.Component

func Separator

func Separator(orientation SeparatorOrientation, decorative bool, classes string, attrs templ.Attributes) templ.Component

func Skeleton

func Skeleton(classes string, attrs templ.Attributes) templ.Component

func Switch

func Switch(name string, defaultChecked, required bool, classes string, attrs templ.Attributes) templ.Component

`attrs` will go to the inner input

func Table

func Table(classes string, attrs templ.Attributes) templ.Component

func TableBody

func TableBody(classes string, attrs templ.Attributes) templ.Component

func TableCaption

func TableCaption(classes string, attrs templ.Attributes) templ.Component

func TableCell

func TableCell(classes string, attrs templ.Attributes) templ.Component

func TableFooter

func TableFooter(classes string, attrs templ.Attributes) templ.Component

func TableHead

func TableHead(classes string, attrs templ.Attributes) templ.Component

func TableHeader

func TableHeader(classes string, attrs templ.Attributes) templ.Component

func TableRow

func TableRow(classes string, attrs templ.Attributes) templ.Component

func Tabs

func Tabs(defaultValue, classes string, attrs templ.Attributes) templ.Component

func TabsContent

func TabsContent(value, classes string, attrs templ.Attributes) templ.Component

func TabsList

func TabsList(classes string, attrs templ.Attributes) templ.Component

func TabsTrigger

func TabsTrigger(value, classes string, attrs templ.Attributes) templ.Component

func Textarea

func Textarea(name, classes string, attrs templ.Attributes) templ.Component

func Toggle

func Toggle(variant ToggleVariant, size ToggleSize, alpinePressed, classes string, attrs templ.Attributes) templ.Component

Types

type AlertVariant

type AlertVariant int
const (
	AlertVariantDefault AlertVariant = iota
	AlertVariantDestructive
)

func (AlertVariant) Class

func (v AlertVariant) Class() string

func (AlertVariant) Icon

func (v AlertVariant) Icon() templ.Component

type BadgeVariant

type BadgeVariant int

func (BadgeVariant) Class

func (v BadgeVariant) Class() string

type ButtonSize

type ButtonSize int
const (
	ButtonSizeDefault ButtonSize = iota
	ButtonSizeSmall
	ButtonSizeLarge
	ButtonSizeIcon
)

func (ButtonSize) Class

func (s ButtonSize) Class() string

type ButtonType

type ButtonType int
const (
	ButtonTypeButton ButtonType = iota
	ButtonTypeSubmit
	ButtonTypeReset
)

func (ButtonType) String

func (t ButtonType) String() string

type ButtonVariant

type ButtonVariant int
const (
	ButtonVariantDefault ButtonVariant = iota
	ButtonVariantDestructive
	ButtonVariantSecondary
	ButtonVariantOutline
	ButtonVariantGhost
	ButtonVariantLink
)

func (ButtonVariant) Class

func (v ButtonVariant) Class() string

type CoreProps

type CoreProps struct {
	// contains filtered or unexported fields
}

func (*CoreProps) Attrs

func (p *CoreProps) Attrs() templ.Attributes

func (*CoreProps) Class

func (p *CoreProps) Class() string

func (*CoreProps) SetAttr

func (p *CoreProps) SetAttr(k string, v any)

func (*CoreProps) SetAttrs

func (p *CoreProps) SetAttrs(a templ.Attributes)

func (*CoreProps) SetClass

func (p *CoreProps) SetClass(c string)

type CorePropsInter

type CorePropsInter interface {
	SetClass(string)
	SetAttrs(templ.Attributes)
	SetAttr(string, any)
	Class() string
	Attrs() templ.Attributes
}
type DropdownMenuAlign int
const (
	DropdownMenuAlignCenter DropdownMenuAlign = iota
	DropdownMenuAlignLeft
	DropdownMenuAlignRight
)
func (a DropdownMenuAlign) Class() string

type InputType

type InputType int
const (
	InputTypeText InputType = iota
	InputTypeEmail
	InputTypePassword
	InputTypeSearch
	InputTypeUrl
	InputTypeTel
	InputTypeDate
	InputTypeDatetimeLocal
	InputTypeNumber
	InputTypeButton
	InputTypeFile
	InputTypeHidden
	InputTypeImage
	InputTypeMonth
	InputTypeWeek
	InputTypeCheckbox
	InputTypeColor
	InputTypeRadio
	InputTypeRange
	InputTypeReset
	InputTypeSubmit
	InputTypeTime
)

func (InputType) String

func (t InputType) String() string

type Option

type Option[T CorePropsInter] func(T)

func WithAttr

func WithAttr[T CorePropsInter](k string, v any) Option[T]

Adds an attribute

func WithAttrs

func WithAttrs[T CorePropsInter](a templ.Attributes) Option[T]

Sets the attributes

func WithClass

func WithClass[T CorePropsInter](c string) Option[T]

Sets the class

type SeparatorOrientation

type SeparatorOrientation int
const (
	SeparatorOrientationVertical SeparatorOrientation = iota
	SeparatorOrientationHorizontal
)

func (SeparatorOrientation) Class

func (o SeparatorOrientation) Class() string

func (SeparatorOrientation) String

func (o SeparatorOrientation) String() string

type ToggleSize

type ToggleSize int
const (
	ToggleSizeDefault ToggleSize = iota
	ToggleSizeSmall
	ToggleSizeLarge
)

func (ToggleSize) Class

func (s ToggleSize) Class() string

type ToggleVariant

type ToggleVariant int
const (
	ToggleVariantDefault ToggleVariant = iota
	ToggleVariantSecondary
)

func (ToggleVariant) Class

func (v ToggleVariant) Class() string

Directories

Path Synopsis
templ: version: v0.2.778
templ: version: v0.2.778
templ: version: v0.2.778
templ: version: v0.2.778
templ: version: v0.2.778
templ: version: v0.2.778
templ: version: v0.2.778
templ: version: v0.2.778

Jump to

Keyboard shortcuts

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