Documentation
¶
Overview ¶
Package popover provides floating content anchored to a trigger element.
Popovers display rich content in a floating panel positioned relative to a trigger element. Unlike tooltips, popovers can contain interactive content and are opened by clicking rather than hovering.
Basic usage:
popover.Popover(
popover.PopoverProps{
Position: forgeui.PositionBottom,
Align: forgeui.AlignStart,
},
button.Button(g.Text("Open Popover")),
html.Div(g.Text("Popover content")),
)
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Popover ¶
Popover creates a popover with floating content anchored to a trigger.
The popover uses Alpine.js for state management and can be positioned on any side of the trigger element (top, right, bottom, left) with different alignments (start, center, end).
Example:
popover.Popover(
popover.PopoverProps{
Position: forgeui.PositionRight,
Align: forgeui.AlignStart,
},
button.Button(g.Text("Settings")),
html.Div(
html.H4(g.Text("Quick Settings")),
html.P(g.Text("Configure your options here")),
),
)
Types ¶
type PopoverProps ¶
type PopoverProps struct {
// Position specifies where the popover appears relative to trigger
Position forgeui.Position
// Align specifies how the popover aligns with the trigger
Align forgeui.Align
// ShowArrow displays a pointer arrow
ShowArrow bool
// Offset is the distance in pixels from the trigger
Offset int
// CloseOnOutsideClick enables closing when clicking outside
CloseOnOutsideClick bool
// Class adds additional CSS classes
Class string
}
PopoverProps defines configuration for a popover
Click to show internal directories.
Click to hide internal directories.