Documentation
¶
Overview ¶
templ: version: v0.3.943
templ: version: v0.3.943
templ: version: v0.3.943
templ: version: v0.3.943
templ: version: v0.3.943
templ: version: v0.3.943
templ: version: v0.3.943
templ: version: v0.3.943
templ: version: v0.3.943
templ: version: v0.3.943
templ: version: v0.3.943
templ: version: v0.3.943
templ: version: v0.3.943
templ: version: v0.3.943
templ: version: v0.3.943
templ: version: v0.3.943
templ: version: v0.3.943
templ: version: v0.3.943
templ: version: v0.3.943
templ: version: v0.3.943
templ: version: v0.3.943
templ: version: v0.3.943
templ: version: v0.3.943
templ: version: v0.3.943
templ: version: v0.3.943
templ: version: v0.3.943
templ: version: v0.3.943
templ: version: v0.3.943
templ: version: v0.3.943
templ: version: v0.3.943
templ: version: v0.3.943
templ: version: v0.3.943
templ: version: v0.3.943
templ: version: v0.3.943
templ: version: v0.3.943
templ: version: v0.3.943
templ: version: v0.3.943
templ: version: v0.3.943
templ: version: v0.3.943
templ: version: v0.3.943
Index ¶
- func Accordion(items []AccordionItem, allowMultiple bool) templ.Component
- func Alert(variant string, title string, message string, dismissible bool) templ.Component
- func Avatar(src string, alt string, size string) templ.Component
- func Badge(text string, color string) templ.Component
- func Breadcrumbs(items []Breadcrumb) templ.Component
- func Button(text string, variant ButtonVariant, attrs templ.Attributes) templ.Component
- func ButtonWithIcon(text string, icon templ.Component, variant ButtonVariant, ...) templ.Component
- func Calendar(name string, selectedDate string) templ.Component
- func Card(config CardConfig, content templ.Component) templ.Component
- func Carousel(id string, items []CarouselItem) templ.Component
- func Checkbox(name string, label string, checked bool, attrs templ.Attributes) templ.Component
- func CheckboxWithDescription(name string, label string, description string, checked bool, ...) templ.Component
- func DarkModeToggle() templ.Component
- func DatePicker(label string, name string, value string, inputType string, required bool, ...) templ.Component
- func Divider(variant string, text string) templ.Component
- func Drawer(id string, title string, content templ.Component, position string) templ.Component
- func Dropdown(label string, items []DropdownItem) templ.Component
- func EventCalendar(id string, events []CalendarEvent) templ.Component
- func FileInput(label string, name string, multiple bool, required bool, accept string, ...) templ.Component
- func FormGroup() templ.Component
- func IconBell() templ.Component
- func IconChart() templ.Component
- func IconCheck(color string) templ.Component
- func IconCheckCircle() templ.Component
- func IconChevronDown() templ.Component
- func IconClock() templ.Component
- func IconCurrency(color string) templ.Component
- func IconDotsVertical() templ.Component
- func IconFolder() templ.Component
- func IconHome() templ.Component
- func IconMenu() templ.Component
- func IconPlus() templ.Component
- func IconSettings() templ.Component
- func IconTrending(color string) templ.Component
- func IconUsers(color string) templ.Component
- func List(items []ListItem, variant string) templ.Component
- func Loading(size string, color string) templ.Component
- func LoadingButton(text string, loadingText string, variant ButtonVariant, loadingVar string, ...) templ.Component
- func LoadingOverlay(message string) templ.Component
- func Menu(items []MenuItem, variant string) templ.Component
- func MenuDivider() templ.Component
- func MenuSection(title string, items []MenuItem) templ.Component
- func MenuTitle(title string) templ.Component
- func Modal(id string, title string, content templ.Component) templ.Component
- func Navbar(logo templ.Component, rightContent templ.Component) templ.Component
- func Pagination(config PaginationConfig) templ.Component
- func Progress(value int, max int, size string, color string, showLabel bool) templ.Component
- func ProjectSelector(currentProject Project, projects []Project) templ.Component
- func Radio(name string, value string, label string, checked bool, attrs templ.Attributes) templ.Component
- func RadioGroup(children templ.Component) templ.Component
- func Rating(maxStars int, selectedStars int, name string, interactive bool, ...) templ.Component
- func Select(label string, name string, placeholder string, required bool, ...) templ.Component
- func SelectOptionItem(option SelectOption) templ.Component
- func SelectOptions(options []SelectOption) templ.Component
- func Sidebar(header templ.Component, content templ.Component, footer templ.Component) templ.Component
- func SidebarContent(header templ.Component, content templ.Component, footer templ.Component, ...) templ.Component
- func Slider(name string, label string, min int, max int, value int, step int, ...) templ.Component
- func Stepper(steps []Step, currentStep int) templ.Component
- func Switch(name string, label string, description string, checked bool, ...) templ.Component
- func Table(headers []string, content templ.Component) templ.Component
- func TableCell(content templ.Component) templ.Component
- func TableRow(content templ.Component) templ.Component
- func Tabs(id string, tabs []Tab) templ.Component
- func TextArea(label string, name string, placeholder string, rows int, required bool, ...) templ.Component
- func TextInput(label string, inputType string, name string, placeholder string, required bool, ...) templ.Component
- func Timeline(items []TimelineItem) templ.Component
- func Toggle(name string, label string, checked bool, attrs templ.Attributes) templ.Component
- func Tooltip(content string, position string, trigger templ.Component) templ.Component
- type AccordionItem
- type Breadcrumb
- type ButtonVariant
- type CalendarEvent
- type CardConfig
- type CarouselItem
- type DropdownItem
- type ListItem
- type MenuItem
- type PaginationConfig
- type Project
- type SelectOption
- type SidebarItem
- type Step
- type Tab
- type TimelineItem
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Accordion ¶
func Accordion(items []AccordionItem, allowMultiple bool) templ.Component
Accordion - Accordion/Collapse component using Alpine.js AllowMultiple: if true, multiple items can be open at once
func Badge ¶
Badge - Colored badge component Colors: gray, red, yellow, green, blue, indigo, purple, pink
func Breadcrumbs ¶
func Breadcrumbs(items []Breadcrumb) templ.Component
Breadcrumbs - Breadcrumb navigation component
func Button ¶
func Button(text string, variant ButtonVariant, attrs templ.Attributes) templ.Component
Button - Reusable button component with variants
func ButtonWithIcon ¶
func ButtonWithIcon(text string, icon templ.Component, variant ButtonVariant, attrs templ.Attributes) templ.Component
ButtonWithIcon - Button with icon and text
func Calendar ¶ added in v0.1.5
Calendar - Interactive calendar component with Alpine.js Usage:
@ui.Calendar("appointment_date", "2025-10-15")
func Card ¶
func Card(config CardConfig, content templ.Component) templ.Component
Card - Unified card component with optional header and variants Usage:
Basic: @ui.Card(CardConfig{}, content)
With Header: @ui.Card(CardConfig{Title: "Title", HeaderAction: action}, content)
Stat Card: @ui.Card(CardConfig{Variant: "stat", StatLabel: "Users", StatValue: "1,234", StatIcon: icon, StatColor: "indigo"}, nil)
func Carousel ¶ added in v0.1.3
func Carousel(id string, items []CarouselItem) templ.Component
Carousel - Image/content carousel component Usage:
@ui.Carousel("my-carousel", items)
func CheckboxWithDescription ¶
func CheckboxWithDescription(name string, label string, description string, checked bool, attrs templ.Attributes) templ.Component
CheckboxWithDescription - Custom styled checkbox with label and description
func DarkModeToggle ¶
DarkModeToggle - Toggle switch for dark/light mode
func DatePicker ¶ added in v0.1.3
func DatePicker(label string, name string, value string, inputType string, required bool, attrs templ.Attributes) templ.Component
DatePicker - Custom date/time picker using our Calendar component and custom time selectors For date type, shows a custom calendar popup For time type, shows custom hour/minute selectors For datetime-local, shows both calendar and time selectors
func Divider ¶
Divider - Visual separator component Variant: horizontal, vertical WithText: optional text in the middle
func Drawer ¶
Drawer - Slide-out drawer component with Alpine.js Position: left, right Usage:
<div x-data>
@ui.Button("Open Drawer", ui.ButtonPrimary, templ.Attributes{"@click": "window.dispatchEvent(new CustomEvent('open-drawer', { detail: 'my_drawer' }))"})
@ui.Drawer("my_drawer", "Drawer Title", DrawerContent(), "right")
</div>
func Dropdown ¶
func Dropdown(label string, items []DropdownItem) templ.Component
Dropdown - Dropdown menu component with Alpine.js
func EventCalendar ¶ added in v0.1.5
func EventCalendar(id string, events []CalendarEvent) templ.Component
EventCalendar - Full-featured event calendar component Usage:
@ui.EventCalendar("my_calendar", events)
func FileInput ¶ added in v0.1.3
func FileInput(label string, name string, multiple bool, required bool, accept string, attrs templ.Attributes) templ.Component
FileInput - File upload input component Usage:
@ui.FileInput("Upload File", "file", false, false, "", templ.Attributes{})
@ui.FileInput("Upload Images", "images", true, false, "image/*", templ.Attributes{})
func IconCheckCircle ¶
IconCheckCircle - Check circle icon (for timeline)
func IconCurrency ¶
IconCurrency - Currency/Money icon
func IconDotsVertical ¶
IconDotsVertical - Three dots vertical icon
func List ¶ added in v0.1.3
List - Styled list component Usage:
@ui.List(items, "default") // default, bordered, divided
func LoadingButton ¶
func LoadingButton(text string, loadingText string, variant ButtonVariant, loadingVar string, attrs templ.Attributes) templ.Component
LoadingButton - Button with loading state
func LoadingOverlay ¶
LoadingOverlay - Full-screen loading overlay
func MenuDivider ¶
MenuDivider - Horizontal line separator between menu sections
func MenuSection ¶
MenuSection - Grouped menu items with optional title
func Modal ¶
Modal - Generic modal component using Alpine.js Usage:
<div x-data>
@ui.Button("Open Modal", ui.ButtonPrimary, templ.Attributes{"@click": "window.dispatchEvent(new CustomEvent('open-modal', { detail: 'my_modal' }))"})
@ui.Modal("my_modal", "Modal Title", ModalContent())
</div>
func Pagination ¶
func Pagination(config PaginationConfig) templ.Component
Pagination - Reusable pagination component
func Progress ¶
Progress - Progress bar component Size: sm, md, lg Color: indigo, green, blue, purple, pink, red, yellow
func ProjectSelector ¶
ProjectSelector - Dropdown to switch between projects
func Radio ¶
func Radio(name string, value string, label string, checked bool, attrs templ.Attributes) templ.Component
Radio - Radio button component with custom styling
func RadioGroup ¶
RadioGroup - Radio group container
func Rating ¶ added in v0.1.3
func Rating(maxStars int, selectedStars int, name string, interactive bool, attrs templ.Attributes) templ.Component
Rating - Star rating component Usage:
@ui.Rating(5, 3, "rating", false, templ.Attributes{}) // 5 stars, 3 selected, read-only
@ui.Rating(5, 0, "rating", true, templ.Attributes{}) // 5 stars, interactive
func Select ¶
func Select(label string, name string, placeholder string, required bool, options []SelectOption) templ.Component
Select - Custom select component with Alpine.js and Tailwind
func SelectOptionItem ¶
func SelectOptionItem(option SelectOption) templ.Component
SelectOptionItem renders a single option
func SelectOptions ¶
func SelectOptions(options []SelectOption) templ.Component
SelectOptions renders the list of options
func Sidebar ¶
func Sidebar(header templ.Component, content templ.Component, footer templ.Component) templ.Component
Sidebar - Responsive sidebar component with slot-based content Desktop: Fixed sidebar on the left Mobile: Collapsible drawer Accepts: header (logo), content (navigation/custom), footer (user info)
func SidebarContent ¶
func SidebarContent(header templ.Component, content templ.Component, footer templ.Component, isMobile bool) templ.Component
SidebarContent - The actual sidebar content (shared between mobile and desktop)
func Slider ¶
func Slider(name string, label string, min int, max int, value int, step int, attrs templ.Attributes) templ.Component
Slider - Range slider component
func Switch ¶
func Switch(name string, label string, description string, checked bool, attrs templ.Attributes) templ.Component
Switch - Toggle switch component
func Table ¶
Table - Reusable responsive table component On mobile: hides, on desktop (md+): shows table
func Tabs ¶
Tabs - Reusable tabs component with Alpine.js Usage:
@ui.Tabs("my-tabs", []ui.Tab{
{ID: "tab1", Label: "Overview", Content: OverviewContent()},
{ID: "tab2", Label: "Settings", Content: SettingsContent()},
})
func TextArea ¶
func TextArea(label string, name string, placeholder string, rows int, required bool, attrs templ.Attributes) templ.Component
TextArea - Text area component
func TextInput ¶
func TextInput(label string, inputType string, name string, placeholder string, required bool, attrs templ.Attributes) templ.Component
TextInput - Text input field component
Types ¶
type AccordionItem ¶
AccordionItem represents a single accordion item
type Breadcrumb ¶
Breadcrumb represents a single breadcrumb item
type ButtonVariant ¶
type ButtonVariant string
ButtonVariant defines button style variants
const ( ButtonPrimary ButtonVariant = "primary" ButtonSecondary ButtonVariant = "secondary" ButtonDanger ButtonVariant = "danger" ButtonSuccess ButtonVariant = "success" )
type CalendarEvent ¶ added in v0.1.5
type CalendarEvent struct {
ID string
Title string
Description string
StartTime time.Time
EndTime time.Time
AllDay bool
Color string // "blue", "red", "green", "purple", "yellow", "pink"
}
CalendarEvent represents a single event on the calendar
type CardConfig ¶
type CardConfig struct {
// Common
Padding string // "default", "none"
// Header variant
Title string
HeaderAction templ.Component
// Stat variant
Variant string // "stat" for stat card
StatLabel string
StatValue string
StatIcon templ.Component
StatColor string // indigo, green, purple, pink, etc.
}
CardConfig - Configuration for card component
type CarouselItem ¶ added in v0.1.3
type CarouselItem struct {
ID string
Content templ.Component
Image string // Optional: direct image URL
Alt string // Alt text for image
}
CarouselItem - Single item in carousel
type DropdownItem ¶
DropdownItem represents a single dropdown menu item
type ListItem ¶ added in v0.1.3
type ListItem struct {
Content templ.Component
Icon templ.Component // Optional icon
Active bool // Highlight as active
Disabled bool // Disabled state
Href string // Optional link
}
ListItem - Single item in a list
type PaginationConfig ¶
type PaginationConfig struct {
CurrentPage int
TotalPages int
TotalItems int
PerPage int
BasePath string // e.g., "/users"
}
PaginationConfig represents pagination configuration
type SelectOption ¶
SelectOption represents an option in a select dropdown
type SidebarItem ¶
type SidebarItem = MenuItem
SidebarItem is an alias for MenuItem for backward compatibility
Source Files
¶
- accordion_templ.go
- alert_templ.go
- avatar_templ.go
- badge_templ.go
- breadcrumbs_templ.go
- button_templ.go
- calendar_templ.go
- card_templ.go
- carousel_templ.go
- checkbox_templ.go
- darkmode_templ.go
- datepicker_templ.go
- divider_templ.go
- drawer_templ.go
- dropdown_templ.go
- event-calendar_templ.go
- fileinput_templ.go
- formgroup_templ.go
- icons_templ.go
- list_templ.go
- loading_templ.go
- menu_templ.go
- modal_templ.go
- navbar_templ.go
- pagination_templ.go
- progress_templ.go
- radio_templ.go
- rating_templ.go
- select_templ.go
- sidebar_templ.go
- slider_templ.go
- stepper_templ.go
- switch_templ.go
- table_templ.go
- tabs_templ.go
- textarea_templ.go
- textinput_templ.go
- timeline_templ.go
- toggle_templ.go
- tooltip_templ.go