Documentation
¶
Overview ¶
templ: version: v0.3.960
Index ¶
- func TooltipContent(args TooltipContentArgs) templ.Component
- func TooltipContentVariants(args TooltipContentArgs) string
- func TooltipTrigger(args TooltipTriggerArgs) templ.Component
- type TooltipContentArgs
- type TooltipHandler
- func (h *TooltipHandler) BuildAnchorStyle(anchorName string) string
- func (h *TooltipHandler) BuildClickOutsideHandler(triggerSelector string) string
- func (h *TooltipHandler) BuildDelayedHideHandler(delayMs int) string
- func (h *TooltipHandler) BuildHideHandler() string
- func (h *TooltipHandler) BuildInstantShowHandler() string
- func (h *TooltipHandler) BuildPositionAnchorStyle(anchorName string) string
- func (h *TooltipHandler) BuildShowHandler(delayMs int) string
- func (h *TooltipHandler) BuildTouchEndHandler() string
- func (h *TooltipHandler) BuildTouchStartHandler(touchHoldMs int) string
- type TooltipSignals
- type TooltipTriggerArgs
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TooltipContent ¶
func TooltipContent(args TooltipContentArgs) templ.Component
TooltipContent creates the tooltip content panel (exactly like PopoverContent)
func TooltipContentVariants ¶
func TooltipContentVariants(args TooltipContentArgs) string
TooltipContentVariants generates CSS classes for tooltip content (matching PopoverContentVariants pattern)
func TooltipTrigger ¶
func TooltipTrigger(args TooltipTriggerArgs) templ.Component
TooltipTrigger creates a trigger for the tooltip that wraps any element
Types ¶
type TooltipContentArgs ¶
type TooltipContentArgs struct {
ID string // Required: Must match TooltipTriggerArgs.TooltipID
Class string
UseAnchor bool // Whether to use CSS anchor positioning
Side utils.AnchorSide // Positioning side
Align utils.AnchorAlign // Alignment
SideOffset int // Offset in pixels from the anchor (default: 4)
Attributes templ.Attributes
}
TooltipContentArgs defines the properties for the tooltip content (matching PopoverContentArgs pattern)
type TooltipHandler ¶
type TooltipHandler struct {
// contains filtered or unexported fields
}
TooltipHandler provides methods for building tooltip-related expressions
func NewTooltipHandler ¶
func NewTooltipHandler(tooltipID string) *TooltipHandler
NewTooltipHandler creates a new tooltip handler
func (*TooltipHandler) BuildAnchorStyle ¶
func (h *TooltipHandler) BuildAnchorStyle(anchorName string) string
BuildAnchorStyle creates anchor positioning style (same as popover)
func (*TooltipHandler) BuildClickOutsideHandler ¶
func (h *TooltipHandler) BuildClickOutsideHandler(triggerSelector string) string
BuildClickOutsideHandler creates handler to dismiss tooltip when clicking outside (like popover)
func (*TooltipHandler) BuildDelayedHideHandler ¶
func (h *TooltipHandler) BuildDelayedHideHandler(delayMs int) string
BuildDelayedHideHandler creates handler to hide tooltip with delay
func (*TooltipHandler) BuildHideHandler ¶
func (h *TooltipHandler) BuildHideHandler() string
BuildHideHandler creates the handler to hide tooltip
func (*TooltipHandler) BuildInstantShowHandler ¶
func (h *TooltipHandler) BuildInstantShowHandler() string
BuildInstantShowHandler creates handler to show tooltip without delay
func (*TooltipHandler) BuildPositionAnchorStyle ¶
func (h *TooltipHandler) BuildPositionAnchorStyle(anchorName string) string
BuildPositionAnchorStyle creates position anchor style (same as popover)
func (*TooltipHandler) BuildShowHandler ¶
func (h *TooltipHandler) BuildShowHandler(delayMs int) string
BuildShowHandler creates the hover/focus handler to show tooltip
func (*TooltipHandler) BuildTouchEndHandler ¶
func (h *TooltipHandler) BuildTouchEndHandler() string
BuildTouchEndHandler creates handler for touch end (cancel if released early)
func (*TooltipHandler) BuildTouchStartHandler ¶
func (h *TooltipHandler) BuildTouchStartHandler(touchHoldMs int) string
BuildTouchStartHandler creates handler for touch start (mobile touch-and-hold)
type TooltipSignals ¶
type TooltipSignals struct {
Open bool `json:"open"`
ShowTimeout string `json:"showTimeout"` // Timeout ID for showing
HideTimeout string `json:"hideTimeout"` // Timeout ID for hiding
TouchHeld bool `json:"touchHeld"` // Whether touch is being held
TouchTimer string `json:"touchTimer"` // Timeout ID for touch-and-hold
}
TooltipSignals defines the state for a tooltip
type TooltipTriggerArgs ¶
type TooltipTriggerArgs struct {
ID string // Optional: ID for the trigger element itself
Class string
TooltipID string // Required: ID of the tooltip content to control
DelayDuration int // Delay in milliseconds before showing tooltip (default 700)
Attributes templ.Attributes
}
TooltipTriggerArgs defines the properties for the tooltip trigger (matching PopoverTriggerArgs pattern)