Documentation
¶
Overview ¶
templ: version: v0.3.833
templ: version: v0.3.833
templ: version: v0.3.833
templ: version: v0.3.833
templ: version: v0.3.833
templ: version: v0.3.833
templ: version: v0.3.833
templ: version: v0.3.833
templ: version: v0.3.833
templ: version: v0.3.833
templ: version: v0.3.833
templ: version: v0.3.833
templ: version: v0.3.833
templ: version: v0.3.833
templ: version: v0.3.833
templ: version: v0.3.833
templ: version: v0.3.833
templ: version: v0.3.833
templ: version: v0.3.833
templ: version: v0.3.833
templ: version: v0.3.833
templ: version: v0.3.833
templ: version: v0.3.833
templ: version: v0.3.833
templ: version: v0.3.833
templ: version: v0.3.833
templ: version: v0.3.833
templ: version: v0.3.833
templ: version: v0.3.833
templ: version: v0.3.833
templ: version: v0.3.833
templ: version: v0.3.833
templ: version: v0.3.833
templ: version: v0.3.833
templ: version: v0.3.833
templ: version: v0.3.833
templ: version: v0.3.833
Index ¶
- Variables
- func Accordion(props AccordionProps) templ.Component
- func Alert(props AlertProps) templ.Component
- func AlertDescription() templ.Component
- func AlertTitle() templ.Component
- func AspectRatio(props AspectRatioProps) templ.Component
- func Avatar(props AvatarProps) templ.Component
- func Badge(props BadgeProps) templ.Component
- func Breadcrumb(props BreadcrumbProps) templ.Component
- func Button(props ButtonProps) templ.Component
- func Card(props CardProps) templ.Component
- func CardContent() templ.Component
- func CardDescription() templ.Component
- func CardFooter() templ.Component
- func CardHeader() templ.Component
- func CardImage(props CardImageProps) templ.Component
- func CardTitle() templ.Component
- func Carousel(props CarouselProps) templ.Component
- func CarouselScript() templ.Component
- func Chart(props ChartProps) templ.Component
- func ChartScripts() templ.Component
- func Checkbox(props CheckboxProps) templ.Component
- func CheckboxCard(props CheckboxCardProps) templ.Component
- func Code(p CodeProps) templ.Component
- func CodeScript() templ.Component
- func DatePicker(props DatePickerProps) templ.Component
- func DatePickerScript() templ.Component
- func DropdownMenu(props DropdownMenuProps) templ.Component
- func DropdownMenuScript() templ.Component
- func FormDescription(props FormDescriptionProps) templ.Component
- func FormItem(props FormItemProps) templ.Component
- func FormItemFlex(props FormItemProps) templ.Component
- func FormLabel(props FormLabelProps) templ.Component
- func FormMessage(props FormMessageProps) templ.Component
- func Input(props InputProps) templ.Component
- func InputOTP(props InputOTPProps) templ.Component
- func InputOTPScript() templ.Component
- func Label(props LabelProps) templ.Component
- func LabelScript() templ.Component
- func Modal(props ModalProps) templ.Component
- func ModalBody() templ.Component
- func ModalClose(id string) templ.Component
- func ModalFooter() templ.Component
- func ModalHeader() templ.Component
- func ModalScript() templ.Component
- func ModalTrigger(id string) templ.Component
- func Pagination(props PaginationProps) templ.Component
- func Progress(props ProgressProps) templ.Component
- func Radio(props RadioProps) templ.Component
- func RadioCard(props RadioCardProps) templ.Component
- func Rating(props RatingProps) templ.Component
- func RatingScript() templ.Component
- func Select(props SelectProps) templ.Component
- func Separator(props SeparatorProps) templ.Component
- func Sheet(props SheetProps) templ.Component
- func SheetClose(text string) templ.Component
- func SheetRoot() templ.Component
- func SheetScript() templ.Component
- func SheetTrigger(text string, side SheetSide) templ.Component
- func Skeleton(props SkeletonProps) templ.Component
- func Slider(props SliderProps) templ.Component
- func SliderScript() templ.Component
- func Spinner(props SpinnerProps) templ.Component
- func Tabs(props TabsProps) templ.Component
- func TabsScript() templ.Component
- func Textarea(props TextareaProps) templ.Component
- func TextareaScript() templ.Component
- func TimePicker(props TimePickerProps) templ.Component
- func TimePickerScript() templ.Component
- func Toast(props ToastProps) templ.Component
- func ToastScript() templ.Component
- func Toggle(props ToggleProps) templ.Component
- func Tooltip(props TooltipProps) templ.Component
- type AccordionItem
- type AccordionProps
- type AlertProps
- type AlertVariant
- type AspectRatioProps
- type AspectRatioType
- type AvatarProps
- type AvatarSize
- type BadgeProps
- type BadgeVariant
- type BreadcrumbItem
- type BreadcrumbProps
- type ButtonProps
- type ButtonSize
- type ButtonVariant
- type CardImagePosition
- type CardImageProps
- type CardProps
- type CarouselProps
- type CarouselSlide
- type ChartConfig
- type ChartData
- type ChartDataset
- type ChartOptions
- type ChartProps
- type ChartType
- type CheckboxCardProps
- type CheckboxProps
- type CodeProps
- type CodeSize
- type DateFormat
- type DateLocale
- type DatePickerConfig
- type DatePickerProps
- type DropdownMenuItem
- type DropdownMenuProps
- type FormDescriptionProps
- type FormItemProps
- type FormLabelProps
- type FormMessageProps
- type InputOTPProps
- type InputProps
- type InputType
- type LabelProps
- type ModalProps
- type PaginationProps
- type PaginationType
- type ProgressProps
- type ProgressSize
- type ProgressVariant
- type RadioCardProps
- type RadioProps
- type RatingProps
- type RatingSize
- type RatingStyle
- type SelectOption
- type SelectProps
- type SeparatorDecoration
- type SeparatorOrientation
- type SeparatorProps
- type SheetProps
- type SheetSide
- type SkeletonProps
- type SliderProps
- type SpinnerProps
- type SpinnerSize
- type Tab
- type TabsProps
- type TextareaProps
- type TimePickerProps
- type ToastProps
- type ToggleProps
- type TooltipProps
- type TooltipSide
- type TooltipVariant
Constants ¶
This section is empty.
Variables ¶
var ( // DateLocaleSpanish provides Spanish localization DateLocaleSpanish = DateLocale{ MonthNames: []string{"Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre"}, DayNames: []string{"Lu", "Ma", "Mi", "Ju", "Vi", "Sa", "Do"}, } // DateLocaleGerman provides German localization DateLocaleGerman = DateLocale{ MonthNames: []string{"Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"}, DayNames: []string{"Mo", "Di", "Mi", "Do", "Fr", "Sa", "So"}, } // DateLocaleFrench provides French localization DateLocaleFrench = DateLocale{ MonthNames: []string{"Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre"}, DayNames: []string{"Lu", "Ma", "Me", "Je", "Ve", "Sa", "Di"}, } // DateLocaleItalian provides Italian localization DateLocaleItalian = DateLocale{ MonthNames: []string{"Gennaio", "Febbraio", "Marzo", "Aprile", "Maggio", "Giugno", "Luglio", "Agosto", "Settembre", "Ottobre", "Novembre", "Dicembre"}, DayNames: []string{"Lu", "Ma", "Me", "Gi", "Ve", "Sa", "Do"}, } // DateLocaleJapanese provides Japanese localization DateLocaleJapanese = DateLocale{ MonthNames: []string{"1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"}, DayNames: []string{"日", "月", "火", "水", "木", "金", "土"}, } )
Pre-defined locales for different languages
var ( // DatePickerISO provides ISO format with default locale DatePickerISO = DatePickerConfig{ Format: DateFormatISO, Locale: DateLocaleDefault, } // DatePickerEU provides European format with default locale DatePickerEU = DatePickerConfig{ Format: DateFormatEU, Locale: DateLocaleDefault, } // DatePickerUK provides UK format with default locale DatePickerUK = DatePickerConfig{ Format: DateFormatUK, Locale: DateLocaleDefault, } // DatePickerUS provides US format with default locale DatePickerUS = DatePickerConfig{ Format: DateFormatUS, Locale: DateLocaleDefault, } // DatePickerUS provides US format with default locale DatePickerLONG = DatePickerConfig{ Format: DateFormatLONG, Locale: DateLocaleDefault, } )
var DateLocaleDefault = DateLocale{ MonthNames: []string{"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"}, DayNames: []string{"Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"}, }
DateLocaleDefault and other locale presets
var TemplFiles embed.FS
Functions ¶
func Accordion ¶
func Accordion(props AccordionProps) templ.Component
func AlertDescription ¶
AlertDescription renders the body content
func AspectRatio ¶
func AspectRatio(props AspectRatioProps) templ.Component
A component for maintaining consistent width-to-height ratios across different screen sizes.
func Avatar ¶
func Avatar(props AvatarProps) templ.Component
Avatar renders a user avatar image or initials
func Badge ¶
func Badge(props BadgeProps) templ.Component
func Breadcrumb ¶
func Breadcrumb(props BreadcrumbProps) templ.Component
Navigation component that helps users understand their location within a website's hierarchy.
func Button ¶
func Button(props ButtonProps) templ.Component
Button renders an interactive element for triggering actions
func CardContent ¶
CardContent renders the main content area of a card.
func CardDescription ¶
CardDescription renders the description of a card.
func CardFooter ¶
CardFooter renders the footer section of a card.
func CardHeader ¶
CardHeader renders the header section of a card.
func CardImage ¶
func CardImage(props CardImageProps) templ.Component
CardImage renders an image section within the card
func Carousel ¶
func Carousel(props CarouselProps) templ.Component
Carousel renders a responsive image and content slider
func CarouselScript ¶
func ChartScripts ¶
ChartScripts ensures Chart.js and initialization code is only loaded once per page This prevents duplicate script loading when multiple charts are used
func Checkbox ¶
func Checkbox(props CheckboxProps) templ.Component
Checkbox renders a styled checkbox input with customizable icon
func CheckboxCard ¶
func CheckboxCard(props CheckboxCardProps) templ.Component
CheckboxCard creates a selectable card component with minimal styling approach
func CodeScript ¶
func DatePicker ¶
func DatePicker(props DatePickerProps) templ.Component
DatePicker renders a date selection input with calendar popup
func DatePickerScript ¶
func DropdownMenu ¶
func DropdownMenu(props DropdownMenuProps) templ.Component
Floating menu for displaying a list of actions or options.
func DropdownMenuScript ¶
func FormDescription ¶
func FormDescription(props FormDescriptionProps) templ.Component
FormDescription renders helper text below form elements
func FormItem ¶
func FormItem(props FormItemProps) templ.Component
FormItem wraps form elements in a vertical layout
func FormItemFlex ¶
func FormItemFlex(props FormItemProps) templ.Component
FormItemFlex wraps form elements in a horizontal layout
func FormLabel ¶
func FormLabel(props FormLabelProps) templ.Component
FormLabel renders a form label
func FormMessage ¶
func FormMessage(props FormMessageProps) templ.Component
FormMessage renders feedback messages
func InputOTP ¶
func InputOTP(props InputOTPProps) templ.Component
InputOTP renders a one-time password input field divided into individual digit inputs
func InputOTPScript ¶
func Label ¶
func Label(props LabelProps) templ.Component
Label renders a form label with error and disabled states
func LabelScript ¶
func Modal ¶
func Modal(props ModalProps) templ.Component
Dialog overlay that requires user attention or interaction.
func ModalClose ¶
ModalClose creates clickable elements that close a modal
func ModalFooter ¶
ModalFooter renders the modal action buttons section
func ModalScript ¶
func ModalTrigger ¶
ModalTrigger creates clickable elements that open a modal
func Pagination ¶
func Pagination(props PaginationProps) templ.Component
Pagination provides navigation through multiple pages of content with various layout and styling options.
func Progress ¶
func Progress(props ProgressProps) templ.Component
Progress renders a progress bar component
func RadioCard ¶
func RadioCard(props RadioCardProps) templ.Component
Selectable card component that uses radio buttons for single-option selection.
func Rating ¶
func Rating(props RatingProps) templ.Component
Rating component for user ratings and feedback
func Select ¶
func Select(props SelectProps) templ.Component
Select renders a styled dropdown selection input
func Separator ¶
func Separator(props SeparatorProps) templ.Component
Separator creates a visual divider between content with optional label
Props:
- Orientation: Direction of the separator ("horizontal" or "vertical"). Default: "horizontal"
- Decoration: Decoration style (none, dashed, dotted). Default: none
- Label: Optional text to display in the middle of the separator
- Class: Additional CSS classes to apply
- Attributes: Additional HTML attributes to apply
func Sheet ¶
func Sheet(props SheetProps) templ.Component
Side-anchored panel that slides in from screen edges.
func SheetClose ¶
SheetClose creates a button that closes the sheet Must be used within Sheet
func SheetRoot ¶
SheetRoot initializes Alpine.js state and event handlers Must wrap Sheet components and triggers
func SheetScript ¶
func SheetTrigger ¶
SheetTrigger creates elements that open the sheet Must be used within SheetRoot
func Skeleton ¶
func Skeleton(props SkeletonProps) templ.Component
Skeleton creates a placeholder element that indicates content is loading It's designed to be a simple building block that users can compose into more complex loading UI patterns
func Slider ¶
func Slider(props SliderProps) templ.Component
Control for selecting a numeric value within a range.
func SliderScript ¶
func Spinner ¶
func Spinner(props SpinnerProps) templ.Component
Spinner component for indicating loading states with customizable options
func TabsScript ¶
func Textarea ¶
func Textarea(props TextareaProps) templ.Component
Textarea renders a multi-line text input field
func TextareaScript ¶
func TimePicker ¶
func TimePicker(props TimePickerProps) templ.Component
A native time selector with support for 12/24 hour formats.
func TimePickerScript ¶
func Toast ¶
func Toast(props ToastProps) templ.Component
func ToastScript ¶
Flexible toast component for notifications and feedback.
func Tooltip ¶
func Tooltip(props TooltipProps) templ.Component
A small pop-up box that appears when a user hovers over an element
Types ¶
type AccordionItem ¶
type AccordionProps ¶
type AccordionProps struct {
Items []AccordionItem // Array of accordion sections
Class string // Additional CSS classes
Attributes templ.Attributes // Additional HTML attributes
}
AccordionProps configures the Accordion component
type AlertProps ¶
type AlertProps struct {
Variant AlertVariant // Visual style variant
Class string // Additional CSS classes
}
type AlertVariant ¶
type AlertVariant string
const ( AlertVariantDefault AlertVariant = "default" AlertVariantDestructive AlertVariant = "destructive" )
type AspectRatioProps ¶
type AspectRatioProps struct {
Ratio AspectRatioType
Class string
Attributes templ.Attributes
}
type AspectRatioType ¶
type AspectRatioType int
AspectRatioType defines the available aspect ratio types as an enum
const ( AspectRatioAuto AspectRatioType = iota // Determined by content AspectRatioSquare // 1:1 ratio AspectRatioVideo // 16:9 ratio AspectRatioPortrait // 3:4 ratio AspectRatioWide // 2:1 ratio )
type AvatarProps ¶
type AvatarProps struct {
ImageSrc string // URL of avatar image
Name string // Name for generating initials
Size AvatarSize // Size variant
Class string // Additional CSS classes
Attributes templ.Attributes // Additional HTML attributes
}
type AvatarSize ¶
type AvatarSize string
const ( AvatarSizeSmall AvatarSize = "small" AvatarSizeMedium AvatarSize = "medium" AvatarSizeLarge AvatarSize = "large" )
type BadgeProps ¶
type BadgeProps struct {
Class string // Additional CSS classes
Text string // Badge text content
Variant BadgeVariant // Visual style variant
IconBefore templ.Component // Icon to display before the text
IconAfter templ.Component // Icon to display after the text
Attributes templ.Attributes // Additional HTML attributes
}
type BadgeVariant ¶
type BadgeVariant string
const ( BadgeVariantDefault BadgeVariant = "default" BadgeVariantSecondary BadgeVariant = "secondary" BadgeVariantDestructive BadgeVariant = "destructive" BadgeVariantOutline BadgeVariant = "outline" )
type BreadcrumbItem ¶
type BreadcrumbItem struct {
Label string // Display text for the breadcrumb item
Href string // URL to navigate to when clicked
Icon templ.Component // Optional icon to display before the label
Current bool // Whether this item represents the current page
Attributes templ.Attributes // Additional HTML attributes
}
BreadcrumbItem represents a single item in the breadcrumb trail
type BreadcrumbProps ¶
type BreadcrumbProps struct {
Items []BreadcrumbItem // Array of breadcrumb items to display
Separator templ.Component // Custom separator between items (defaults to chevron)
Class string // Additional CSS classes
Attributes templ.Attributes // Additional HTML attributes
}
BreadcrumbProps configures the Breadcrumb component
type ButtonProps ¶
type ButtonProps struct {
Class string // Additional CSS classes
Text string // Button label text
Variant ButtonVariant // Visual style
Size ButtonSize // Button dimensions
FullWidth bool // Expand to fill container
Href string // URL for link buttons
Target string // Link target attribute
Disabled bool // Interactivity state
Type string // Button type attribute
IconLeft templ.Component // Icon component before text
IconRight templ.Component // Icon component after text
HxGet string // HTMX: URL for GET requests
HxPost string // HTMX: URL for POST requests
HxPut string // HTMX: URL for PUT requests
HxDelete string // HTMX: URL for DELETE requests
HxTrigger string // HTMX: Trigger event
HxTarget string // HTMX: Target for response
HxSwap string // HTMX: Method for inserting response
Attributes templ.Attributes // Additional HTML attributes
}
ButtonProps configures the Button component
type ButtonSize ¶
type ButtonSize string
ButtonSize defines the dimensions of the button
const ( ButtonSizeMd ButtonSize = "md" ButtonSizeSm ButtonSize = "sm" ButtonSizeLg ButtonSize = "lg" ButtonSizeIcon ButtonSize = "icon" )
Button sizes
type ButtonVariant ¶
type ButtonVariant string
ButtonVariant defines the visual style of the button
const ( ButtonVariantDefault ButtonVariant = "default" ButtonVariantDestructive ButtonVariant = "destructive" ButtonVariantOutline ButtonVariant = "outline" ButtonVariantSecondary ButtonVariant = "secondary" ButtonVariantGhost ButtonVariant = "ghost" ButtonVariantLink ButtonVariant = "link" )
Button variants
type CardImagePosition ¶
type CardImagePosition string
const ( CardImageTop CardImagePosition = "top" CardImageBottom CardImagePosition = "bottom" CardImageLeft CardImagePosition = "left" CardImageRight CardImagePosition = "right" )
type CardImageProps ¶
type CardProps ¶
type CardProps struct {
Horizontal bool // Enables horizontal layout for side images
Class string // Additional CSS classes
Attributes templ.Attributes // Additional HTML attributes
}
type CarouselProps ¶
type CarouselProps struct {
ID string // Unique identifier for the carousel
Slides []CarouselSlide // Array of carousel slides
ShowControls bool // Whether to display previous/next buttons
ShowIndicators bool // Whether to display pagination indicators
Autoplay bool // Whether the carousel should autoplay
Interval int // Autoplay interval in milliseconds (default: 5000)
Loop bool // Whether the carousel should loop back to the beginning
Class string // Additional CSS classes
Attributes templ.Attributes // Additional HTML attributes
}
CarouselProps configures the Carousel component
type CarouselSlide ¶
type CarouselSlide struct {
Content templ.Component // Main content of the slide
Description string // Optional description
Attributes templ.Attributes // Additional HTML attributes for each slide
}
CarouselSlide represents an individual slide in the carousel
type ChartConfig ¶
type ChartConfig struct {
Type ChartType `json:"type"` // Type of chart (line, bar, etc.)
Data ChartData `json:"data"` // Data and datasets
Options ChartOptions `json:"options,omitempty"` // Chart display options
ShowLegend bool `json:"showLegend,omitempty"` // Whether to display the legend
ShowXAxis bool `json:"showXAxis"` // Whether to display the X-axis line
ShowYAxis bool `json:"showYAxis"` // Whether to display the Y-axis line
ShowXLabels bool `json:"showXLabels"` // Whether to display X-axis labels
ShowYLabels bool `json:"showYLabels"` // Whether to display Y-axis labels
ShowXGrid bool `json:"showXGrid"` // Whether to display X-axis grid lines
ShowYGrid bool `json:"showYGrid"` // Whether to display Y-axis grid lines
Horizontal bool `json:"horizontal"` // Whether the chart should be horizontal
Stacked bool `json:"stacked"` // Whether datasets should be stacked
}
ChartConfig represents the complete Chart.js configuration This is the full configuration that gets passed to Chart.js
type ChartData ¶
type ChartData struct {
Labels []string `json:"labels"` // Labels for data points (X-axis labels for most charts)
Datasets []ChartDataset `json:"datasets"` // Array of datasets to be displayed
}
ChartData represents all data needed for Chart.js Contains both the dataset and labels
type ChartDataset ¶
type ChartDataset struct {
Label string `json:"label"` // Name of the dataset to be displayed in legend
Data []float64 `json:"data"` // Actual data points for the chart
BorderWidth int `json:"borderWidth,omitempty"` // Width of the line/bar border in pixels
BorderColor string `json:"borderColor,omitempty"` // Color of the line/bar border
BackgroundColor string `json:"backgroundColor,omitempty"` // Background/fill color of the chart elements
Tension float64 `json:"tension,omitempty"` // Smoothing of the line (0 = straight lines, 1 = maximum curve)
Fill bool `json:"fill,omitempty"` // Whether to fill the area under the line
Stepped bool `json:"stepped,omitempty"` // Whether to draw the line as a stepped line
}
ChartDataset represents a dataset for Chart.js Contains the data points and visual styling for a single data series
type ChartOptions ¶
type ChartOptions struct {
Responsive bool `json:"responsive,omitempty"` // Whether the chart should resize with its container
Legend bool `json:"legend,omitempty"` // Whether to display the legend
}
ChartOptions represents Chart.js options Contains general chart configuration options
type ChartProps ¶
type ChartProps struct {
Type ChartType // Type of chart to render
Data ChartData // Data to display in the chart
Options ChartOptions // Additional chart options
ShowLegend bool // Whether to display the legend
ShowXAxis bool // Whether to display the X-axis line
ShowYAxis bool // Whether to display the Y-axis line
ShowXLabels bool // Whether to display X-axis labels
ShowYLabels bool // Whether to display Y-axis labels
ShowXGrid bool // Whether to display X-axis grid lines
ShowYGrid bool // Whether to display Y-axis grid lines
Horizontal bool // Whether the chart should be horizontal
Stacked bool // Whether datasets should be stacked
Class string // Additional CSS classes
}
ChartProps for the Chart component Properties that can be passed to the Chart component
type CheckboxCardProps ¶
type CheckboxCardProps struct {
ID string // DOM identifier
Name string // Form field name
Value string // Checkbox value
Checked bool // Selected state
Disabled bool // Prevents interaction
Required bool // Required
Title string // Card title
Description string // Card description
Icon templ.Component // Optional icon
Class string // Additional CSS classes for the card
Attributes templ.Attributes // Additional HTML attributes
}
CheckboxCardProps configures the CheckboxCard component
type CheckboxProps ¶
type CheckboxProps struct {
ID string // DOM identifier
Name string // Form field name
Value string // Checkbox value
Disabled bool // Prevents interaction
Required bool // Required
Checked bool // Selected state
Icon templ.Component // Custom check icon
Class string // Additional CSS classes
Attributes templ.Attributes // Additional HTML attributes
}
CheckboxProps configures the Checkbox component
type DateFormat ¶
type DateFormat string
DateFormat defines date formatting options
const ( DateFormatISO DateFormat = "iso" // ISO format (YYYY-MM-DD) DateFormatEU DateFormat = "eu" // European format (DD.MM.YYYY) DateFormatUK DateFormat = "uk" // UK format (DD/MM/YYYY) DateFormatUS DateFormat = "us" // US format (MM/DD/YYYY) DateFormatLONG DateFormat = "long" // Long format (Month DD, YYYY) )
type DateLocale ¶
type DateLocale struct {
MonthNames []string // Localized month names
DayNames []string // Localized day names
}
DateLocale configures locale-specific settings
type DatePickerConfig ¶
type DatePickerConfig struct {
Format DateFormat // Date format style
Locale DateLocale // Localization settings
}
DatePickerConfig combines format and locale settings
func NewDatePickerConfig ¶
func NewDatePickerConfig(format DateFormat, locale DateLocale) DatePickerConfig
NewDatePickerConfig creates a new configuration with specified format and locale
type DatePickerProps ¶
type DatePickerProps struct {
ID string // DOM identifier
Name string // Form field name
Value time.Time // Selected date
Config DatePickerConfig // Format and locale config
Placeholder string // Helper text shown when empty
Disabled bool // Prevents interaction
HasError bool // Error state styling
Class string // Additional CSS classes
Attributes templ.Attributes // Additional HTML attributes
}
DatePickerProps configures the DatePicker component
type DropdownMenuItem ¶
type DropdownMenuItem struct {
Label string // Display text
Value string // Optional value
Href string // Optional link URL
Target string // Optional link target
IconLeft templ.Component // Optional icon on the left
IconRight templ.Component // Optional icon on the right
SubItems []DropdownMenuItem // Nested submenu items
Disabled bool // Disables the item
Attributes templ.Attributes // Additional HTML attributesß
}
type DropdownMenuProps ¶
type DropdownMenuProps struct {
Items []DropdownMenuItem // Menu items
Trigger templ.Component // Custom trigger element
Class string // Additional CSS classes
Position string // Preferred placement
}
type FormDescriptionProps ¶
type FormDescriptionProps struct {
Class string // Additional CSS classes
}
FormDescriptionProps represents helper text properties
type FormItemProps ¶
type FormItemProps struct {
ID string // Optional container ID
Class string // Additional CSS classes
}
FormItemProps represents form item properties
type FormLabelProps ¶
type FormLabelProps struct {
For string // Target form element ID
Text string // Label text
Class string // Additional CSS classes
DisabledClass string // Additional CSS classes when the form element is disabled
}
FormLabelProps represents form label properties
type FormMessageProps ¶
type FormMessageProps struct {
Type string // error, success, warning, info
Message string // Message text
Class string // Additional CSS classes
}
FormMessageProps represents feedback message properties
type InputOTPProps ¶
type InputOTPProps struct {
ID string // DOM identifier
Name string // Form field name
Value string // Current OTP value
Length int // Number of digits in the OTP (default: 6)
Type string // Input type (default: "text", can also be "number", "password", etc.)
Placeholder string // Character to show in empty fields (default: "•")
Disabled bool // Prevents interaction
Required bool // Required form field
HasError bool // Error state styling
Class string // Additional CSS classes
Attributes templ.Attributes // Additional HTML attributes
}
InputOTPProps configures the OTP input component
type InputProps ¶
type InputProps struct {
Type InputType // Input field type
Placeholder string // Helper text shown when empty
Value string // Current input value
Name string // Form field name
ID string // DOM identifier
Disabled bool // Prevents interaction
Readonly bool // Allows selection only
Required bool // Required
FileAccept string // Allowed file types
HasError bool // Error state styling
Class string // Additional CSS classes
Attributes templ.Attributes // Additional HTML attributes
}
type InputType ¶
type InputType string
const ( InputTypeText InputType = "text" InputTypePassword InputType = "password" InputTypeEmail InputType = "email" InputTypeNumber InputType = "number" InputTypeTel InputType = "tel" InputTypeURL InputType = "url" InputTypeSearch InputType = "search" InputTypeDate InputType = "date" InputTypeTime InputType = "time" InputTypeFile InputType = "file" )
type LabelProps ¶
type ModalProps ¶
type PaginationProps ¶
type PaginationProps struct {
CurrentPage int // Current active page (1-based index)
TotalPages int // Total number of pages
PageSize int // Number of items per page
TotalItems int // Total number of items (alternative to TotalPages)
MaxVisible int // Maximum number of page buttons to show
Type PaginationType // Visual style variation
ShowNumbers bool // Whether to show page numbers
ShowControls bool // Whether to show next/previous buttons
UrlPattern string // URL pattern for links, use {page} placeholder, e.g. "/products?page={page}"
HxGet bool // Whether to use hx-get instead of href for HTMX integration
HxTarget string // Target element for HTMX updates
HxSwap string // Swap method for HTMX updates
Class string // Additional CSS classes
Attributes templ.Attributes // Additional HTML attributes
}
PaginationProps configures the Pagination component
type PaginationType ¶
type PaginationType string
PaginationType defines the visual style of pagination
const ( // PaginationTypeDefault shows numbered pages with first/last and next/previous controls PaginationTypeDefault PaginationType = "default" // PaginationTypeSimple shows only next/previous controls PaginationTypeSimple PaginationType = "simple" // PaginationTypeMinimal shows compact numbered pages with next/previous PaginationTypeMinimal PaginationType = "minimal" // PaginationTypeOutline uses outlined styling PaginationTypeOutline PaginationType = "outline" )
type ProgressProps ¶
type ProgressProps struct {
Value int // Current progress value (0-100)
Max int // Maximum value (default: 100)
Label string // Optional text label
ShowValue bool // Whether to show percentage
Size ProgressSize // Size variant (sm, md, lg)
Variant ProgressVariant // Color variant
Class string // Additional CSS classes
BarClass string // Additional CSS classes for the bar itself
HxGet string // HTMX endpoint for updates
HxTrigger string // HTMX trigger for updates
HxTarget string // HTMX target for updates
HxSwap string // HTMX swap method
Attributes templ.Attributes // Additional HTML attributes
}
ProgressProps configures the Progress component
type ProgressSize ¶
type ProgressSize string
ProgressSize defines available sizes for the Progress component
const ( ProgressSizeDefault ProgressSize = "" // Default size ProgressSizeSm ProgressSize = "sm" // Small progress bar ProgressSizeLg ProgressSize = "lg" // Large progress bar )
type ProgressVariant ¶
type ProgressVariant string
ProgressVariant defines color variants
const ( ProgressVariantDefault ProgressVariant = "default" // Default styling ProgressVariantSuccess ProgressVariant = "success" // Success state ProgressVariantDanger ProgressVariant = "danger" // Error/danger state ProgressVariantWarning ProgressVariant = "warning" // Warning state )
type RadioCardProps ¶
type RadioCardProps struct {
ID string // DOM identifier
Name string // Form field name
Value string // Radio value
Checked bool // Selected state
Disabled bool // Prevents interaction
Required bool // Required
Title string // Card title
Description string // Card description
Icon templ.Component // Optional icon
Class string // Additional CSS classes for the card
Attributes templ.Attributes // Additional HTML attributes
}
RadioCardProps configures the RadioCard component
type RadioProps ¶
type RadioProps struct {
Value string // Radio button value
Name string // Form field name
ID string // DOM identifier
Disabled bool // Prevents interaction
Required bool // Required
Checked bool // Selected state
Class string // Additional CSS classes
Attributes templ.Attributes // Additional HTML attributes
}
type RatingProps ¶
type RatingProps struct {
Value float64 // Current rating value
MaxValue int // Maximum rating value (default: 5)
ReadOnly bool // Whether the rating is interactive or display-only
Style RatingStyle // Visual style for the rating
Size RatingSize // Size of the rating elements
Precision float64 // Step precision for fractional ratings (0.5, 0.1, etc.)
Name string // Form field name (when used in forms)
ShowValue bool // Whether to display the numeric value
OnlyInteger bool // Force ratings to integer values
Class string // Additional CSS classes
Attributes templ.Attributes // Additional HTML attributes
}
RatingProps configures the Rating component
type RatingSize ¶
type RatingSize string
RatingSize defines available sizes for the Rating component
type RatingStyle ¶
type RatingStyle string
RatingStyle defines the visual style for the Rating component
const ( RatingStyleStar RatingStyle = "star" // Star icons for ratings RatingStyleHeart RatingStyle = "heart" // Heart icons for ratings RatingStyleEmoji RatingStyle = "emoji" // Emoji faces for ratings RatingStyleNumeric RatingStyle = "numeric" // Numeric display (with optional icon) )
type SelectOption ¶
type SelectOption struct {
Label string // Display text
Value string // Form value
Selected bool // Default selection
Attributes templ.Attributes // Additional HTML attributes
}
type SelectProps ¶
type SelectProps struct {
ID string // DOM identifier
Name string // Form field name
Placeholder string // Helper text shown when empty
Options []SelectOption // Available choices
Disabled bool // Prevents interaction
Required bool // Required
HasError bool // Error state styling
Class string // Additional CSS classes
Attributes templ.Attributes // Additional HTML attributes
}
type SeparatorDecoration ¶
type SeparatorDecoration string
SeparatorDecoration defines the decoration style of the separator
const ( // SeparatorDecorationNone defines no decoration style SeparatorDecorationNone SeparatorDecoration = "none" // SeparatorDecorationDashed defines a dashed decoration style SeparatorDecorationDashed SeparatorDecoration = "dashed" // SeparatorDecorationDotted defines a dotted decoration style SeparatorDecorationDotted SeparatorDecoration = "dotted" )
type SeparatorOrientation ¶
type SeparatorOrientation string
SeparatorOrientation defines the orientation of the separator
const ( // SeparatorOrientationHorizontal defines a horizontal separator SeparatorOrientationHorizontal SeparatorOrientation = "horizontal" // SeparatorOrientationVertical defines a vertical separator SeparatorOrientationVertical SeparatorOrientation = "vertical" )
type SeparatorProps ¶
type SeparatorProps struct {
Orientation SeparatorOrientation // Direction of the separator (horizontal or vertical)
Decoration SeparatorDecoration // Decoration style (none, dashed, dotted)
Label string // Optional label text to display in the middle
Class string // Additional CSS classes
Attributes templ.Attributes // Additional HTML attributes
}
SeparatorProps configures the Separator component
type SheetProps ¶
type SkeletonProps ¶
type SkeletonProps struct {
Class string // Additional CSS classes to apply to the skeleton element
Attributes templ.Attributes // Additional attributes to apply to the skeleton element
}
type SliderProps ¶
type SliderProps struct {
ID string // Unique identifier for the slider
Name string // Input name attribute
Min int // Minimum value
Max int // Maximum value
Step int // Value increment
Value int // Initial value
Label string // Optional label text
ShowValue bool // Show current value
ValueFormat string // Optional format suffix
Disabled bool // Disables the slider
Class string // Additional CSS classes
Attributes templ.Attributes // Additional HTML attributes
}
type SpinnerProps ¶
type SpinnerProps struct {
Size SpinnerSize // Controls the size of the spinner (sm, md, lg)
Color string // Custom color - uses theme colors if empty
Text string // Optional text to display below the spinner
Class string // Additional CSS classes
Attributes templ.Attributes // Additional HTML attributes
}
SpinnerProps configures the Spinner component
type SpinnerSize ¶
type SpinnerSize string
SpinnerSize represents the available sizes for the Spinner component
const ( SpinnerSizeSm SpinnerSize = "sm" // Small (24px) SpinnerSizeMd SpinnerSize = "md" // Medium (32px) - default SpinnerSizeLg SpinnerSize = "lg" // Large (48px) )
type TextareaProps ¶
type TextareaProps struct {
ID string // DOM identifier
Name string // Form field name
Value string // Initial content
Placeholder string // Helper text shown when empty
Rows int // Visible lines of text
Disabled bool // Prevents interaction
Required bool // Required
AutoResize bool // Enables dynamic resizing
Class string // Additional CSS classes
Attributes templ.Attributes // Additional HTML attributes
}
type TimePickerProps ¶
type TimePickerProps struct {
ID string // Unique identifier
Name string // Form input name
Value time.Time // Initial time value
Use12Hours bool // Enable 12-hour format with AM/PM
AMLabel string // AM label for 12-hour format
PMLabel string // PM label for 12-hour format
Placeholder string // Input placeholder text
Required bool // Required form field
Disabled bool // Disable interactivity
HasError bool // Error state styling
Class string // Additional CSS classes
Attributes templ.Attributes // Additional HTML attributes
}
type ToastProps ¶
type ToggleProps ¶
type TooltipProps ¶
type TooltipProps struct {
Trigger templ.Component // The element that triggers the tooltip
Content templ.Component // The tooltip content
Side TooltipSide // Tooltip position relative to trigger
ShowArrow bool // Whether to show the arrow pointer
Variant TooltipVariant // Visual style variant
Class string // Additional CSS classes
Attributes templ.Attributes // Additional HTML attributes
}
TooltipProps configures the Tooltip component
type TooltipSide ¶
type TooltipSide string
TooltipSide definiert die Position des Tooltips relativ zum Trigger
const ( TooltipTop TooltipSide = "top" TooltipRight TooltipSide = "right" TooltipBottom TooltipSide = "bottom" TooltipLeft TooltipSide = "left" )
type TooltipVariant ¶
type TooltipVariant string
const ( TooltipDefault TooltipVariant = "default" TooltipSecondary TooltipVariant = "secondary" TooltipDestructive TooltipVariant = "destructive" )
Source Files
¶
- accordion_templ.go
- alert_templ.go
- aspect_ratio_templ.go
- avatar_templ.go
- badge_templ.go
- breadcrumb_templ.go
- button_templ.go
- card_templ.go
- carousel_templ.go
- chart_templ.go
- checkbox_card_templ.go
- checkbox_templ.go
- code_templ.go
- date_picker_templ.go
- dropdown_menu_templ.go
- embed.go
- form_templ.go
- input-otp_templ.go
- input_templ.go
- label_templ.go
- modal_templ.go
- pagination_templ.go
- progress_templ.go
- radio_card_templ.go
- radio_templ.go
- rating_templ.go
- select_templ.go
- separator_templ.go
- sheet_templ.go
- skeleton_templ.go
- slider_templ.go
- spinner_templ.go
- tabs_templ.go
- textarea_templ.go
- time_picker_templ.go
- toast_templ.go
- toggle_templ.go
- tooltip_templ.go