Documentation
¶
Overview ¶
templ: version: v0.3.977
Index ¶
- Constants
- func ButtonGroup(props ButtonGroupProps) templ.Component
- func RadioGroup(props RadioGroupProps) templ.Component
- func SetThemeHandler() http.HandlerFunc
- func Toggle(props ToggleProps) templ.Component
- type ButtonGroupProps
- type RadioGroupProps
- type ThemeOption
- type ThemeSignals
- type ToggleProps
Constants ¶
View Source
const SetThemePath = "/api/theme"
SetThemePath is the route path for the theme persistence endpoint.
Variables ¶
This section is empty.
Functions ¶
func ButtonGroup ¶
func ButtonGroup(props ButtonGroupProps) templ.Component
func RadioGroup ¶
func RadioGroup(props RadioGroupProps) templ.Component
func SetThemeHandler ¶ added in v0.0.7
func SetThemeHandler() http.HandlerFunc
SetThemeHandler returns an HTTP handler that persists the selected theme to the session store. It reads the theme from Datastar signals and stores it using the SessionStore from WebXContext.
func Toggle ¶
func Toggle(props ToggleProps) templ.Component
Types ¶
type ButtonGroupProps ¶
type ButtonGroupProps struct {
ID string
Class string
Attributes templ.Attributes
Default string // initially selected theme
Themes []ThemeOption // available themes
}
ButtonGroupProps configures a button-strip theme selector.
type RadioGroupProps ¶
type RadioGroupProps struct {
ID string
Class string
Attributes templ.Attributes
Default string // initially selected theme
Themes []ThemeOption // available themes
}
RadioGroupProps configures radio buttons for selecting from multiple themes.
type ThemeOption ¶
ThemeOption represents a selectable theme.
type ThemeSignals ¶
type ThemeSignals struct {
Theme string `json:"theme"`
}
ThemeSignals holds the reactive theme state.
type ToggleProps ¶
type ToggleProps struct {
ID string
Class string
Attributes templ.Attributes
Theme string // theme to apply when toggled on
Default string // theme when toggled off (defaults to "default")
}
ToggleProps configures a toggle switch between two themes.
Click to show internal directories.
Click to hide internal directories.