Documentation
¶
Overview ¶
templ: version: v0.3.977
Index ¶
- func Action(props ...ActionProps) templ.Component
- func Backdrop(modalID string) templ.Component
- func Box(props ...BoxProps) templ.Component
- func CloseButton(modalID string, props ...CloseButtonProps) templ.Component
- func Modal(props Props) templ.Component
- func OpenButton(modalID string, props ...OpenButtonProps) templ.Component
- type ActionProps
- type BoxProps
- type CloseButtonProps
- type ModalSignals
- type OpenButtonProps
- type Position
- type Props
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Action ¶
func Action(props ...ActionProps) templ.Component
Action renders the modal-action area for buttons.
func Backdrop ¶
Backdrop renders a click-outside overlay that closes the modal. Must be placed as a sibling of modal-box inside the modal div.
func CloseButton ¶
func CloseButton(modalID string, props ...CloseButtonProps) templ.Component
CloseButton renders a close button inside the modal.
func Modal ¶
Modal renders a DaisyUI modal controlled by Datastar signals. Uses a hidden checkbox (.modal-toggle) with data-attr:checked to sync state.
func OpenButton ¶
func OpenButton(modalID string, props ...OpenButtonProps) templ.Component
OpenButton renders a button that opens the modal.
Types ¶
type ActionProps ¶
type ActionProps struct {
Class string
Attributes templ.Attributes
}
ActionProps configures the modal action area.
type BoxProps ¶
type BoxProps struct {
ID string
Class string
Attributes templ.Attributes
}
BoxProps configures the modal content box.
type CloseButtonProps ¶
type CloseButtonProps struct {
Class string
Attributes templ.Attributes
}
type ModalSignals ¶
type ModalSignals struct {
Open bool `json:"open"`
}
ModalSignals holds the reactive state for a modal.
type OpenButtonProps ¶
type OpenButtonProps struct {
Class string
Attributes templ.Attributes
}
Click to show internal directories.
Click to hide internal directories.