SystemPopover
Presents QuickGUI content in a separate native child window that can extend beyond its owner.
#Import
Import ui from github.com/egoist/quickgui/go/ui.
import (
"github.com/egoist/quickgui/go/ui"
)#Usage
func SystemPopoverExample() *ui.Element {
popover := ui.NewSystemPopover()
return popover.Root().Children(
popover.Trigger().Child("Account"),
popover.Content(ui.PopoverContentProps{Width: 240, Height: 120, Placement: "bottom-start"}).Child("Account settings"),
)
}#Anatomy
systemPopover.RootsystemPopover.TriggersystemPopover.Content
#API reference
Expand an entry for its description and complete signature. A dash means no declaration default is documented.
NewSystemPopover
View sourceui.NewSystemPopover(props ...PopoverRootProps) *SystemPopoverComponentNewSystemPopover declares a SystemPopover instance. Optional props provide initial settings.
ChildrenComponent—
Content mounted inside the component. Compound child callbacks run after the parent context exists.
ComponentView sourceOpenfunc() bool—
Controlled visibility of the panel or overlay. Pair with the open-change callback.
func() boolView sourceDefaultOpenbool—
OnOpenChangefunc(bool, PopoverOpenChangeDetails)—
Reports a requested visibility change, including dismissal.
func(bool, PopoverOpenChangeDetails)View sourceDismissOnEscape*bool—
DismissOnPointerOutside*bool—
Modal*bool—
OpenOnHover*bool—
Delayany—
CloseDelayany—
OnPlacementChangefunc(AnchorPlacementDetails, *native.Event)—
Callback for placement change. The signature below lists the event payload.
func(AnchorPlacementDetails, *native.Event)View sourceSidePopoverSide—
AlignPopoverAlign—
SideOffset*float64—
AlignOffset*float64—
CollisionPadding*float64—
Sticky*bool—
Anchor*native.Node—
SystemPopover.Open
View sourcesystemPopover.Open(value any) *SystemPopoverComponentControlled visibility of the panel or overlay. Pair with the open-change callback.
SystemPopover.DefaultOpen
View sourcesystemPopover.DefaultOpen(value bool) *SystemPopoverComponentInitial visibility when the component owns its open state.
SystemPopover.OnOpenChange
View sourcesystemPopover.OnOpenChange(value func(bool, PopoverOpenChangeDetails)) *SystemPopoverComponentReports a requested visibility change, including dismissal.
SystemPopover.DismissOnEscape
View sourcesystemPopover.DismissOnEscape(value bool) *SystemPopoverComponentAllows Escape to dismiss the surface.
SystemPopover.DismissOnPointerOutside
View sourcesystemPopover.DismissOnPointerOutside(value bool) *SystemPopoverComponentAllows a pointer press outside the surface to dismiss it.
SystemPopover.Modal
View sourcesystemPopover.Modal(value bool) *SystemPopoverComponentContains focus and blocks interaction behind the surface.
SystemPopover.OpenOnHover
View sourcesystemPopover.OpenOnHover(value bool) *SystemPopoverComponentOpens the surface when its trigger is hovered.
SystemPopover.Delay
View sourcesystemPopover.Delay(value any) *SystemPopoverComponentCore-owned delay in milliseconds before opening.
SystemPopover.CloseDelay
View sourcesystemPopover.CloseDelay(value any) *SystemPopoverComponentCore-owned delay in milliseconds before closing.
SystemPopover.OnPlacementChange
View sourcesystemPopover.OnPlacementChange(value func(AnchorPlacementDetails, *native.Event)) *SystemPopoverComponentCallback for placement change. The signature below lists the event payload.
SystemPopover.Side
View sourcesystemPopover.Side(value PopoverSide) *SystemPopoverComponentPreferred placement side before collision handling.
SystemPopover.Align
View sourcesystemPopover.Align(value PopoverAlign) *SystemPopoverComponentPreferred alignment on the placement cross-axis.
SystemPopover.SideOffset
View sourcesystemPopover.SideOffset(value float64) *SystemPopoverComponentDistance from the anchor on the chosen side, in logical pixels.
SystemPopover.AlignOffset
View sourcesystemPopover.AlignOffset(value float64) *SystemPopoverComponentOffset along the anchor’s cross axis, in logical pixels.
SystemPopover.CollisionPadding
View sourcesystemPopover.CollisionPadding(value float64) *SystemPopoverComponentSpace reserved between the positioned surface and the available viewport edges.
SystemPopover.Sticky
View sourcesystemPopover.Sticky(value bool) *SystemPopoverComponentKeeps the positioned surface attached to its anchor within available bounds.
SystemPopover.Anchor
View sourcesystemPopover.Anchor(value *native.Node) *SystemPopoverComponentElement used as the placement anchor for this surface.
SystemPopover.Root
View sourcesystemPopover.Root() *ElementConfigures root for this part. The declared type and source define the accepted value.
SystemPopover.Trigger
View sourcesystemPopover.Trigger(options ...PopoverTriggerProps) *ElementConfigures trigger for this part. The declared type and source define the accepted value.
Reffunc(*native.Node)—
Receives the retained native node after construction. Keep imperative work in event or lifecycle callbacks.
func(*native.Node)View sourceStyleany—
Reusable layout, typography, color, and interaction-state styles. Build with ui.Style() and compose with Merge.
anyView sourceChildrenPartChildren—
Content mounted inside the component. Compound child callbacks run after the parent context exists.
PartChildrenView sourceDisabledany—
Prevents activation and exposes the disabled state to accessibility. Compound parts inherit a disabled root.
anyView sourceRolestring—
FocusOnPointerany—
Groupany—
AriaLabelany—
Accessible name, especially for icon-only controls or controls without a visible label.
anyView sourceTabIndex*float64—
Controls sequential keyboard focus order. Omit to retain the component’s default focus behavior.
*float64View sourceOnClickfunc(*native.Event)—
Called after QuickGUI resolves an activation, including supported keyboard activation.
func(*native.Event)View sourceOnDoubleClickfunc(*native.Event)—
Callback for double click. The signature below lists the event payload.
func(*native.Event)View sourceOnContextMenufunc(*native.Event)—
Callback for context menu. The signature below lists the event payload.
func(*native.Event)View sourceOnPointerfunc(*native.Event)—
OnMouseEnterfunc(*native.Event)—
Callback for mouse enter. The signature below lists the event payload.
func(*native.Event)View sourceOnMouseLeavefunc(*native.Event)—
Callback for mouse leave. The signature below lists the event payload.
func(*native.Event)View sourceOnMouseDownfunc(*native.Event)—
OnMouseUpfunc(*native.Event)—
OnKeyDownfunc(*native.Event)—
OnKeyUpfunc(*native.Event)—
OnFocusfunc(*native.Event)—
OnBlurfunc(*native.Event)—
OpenOnHover*bool—
Delayany—
CloseDelayany—
SystemPopover.Content
View sourcesystemPopover.Content(options ...PopoverContentProps) *ElementConfigures content for this part. The declared type and source define the accepted value.
Reffunc(*native.Node)—
Receives the retained native node after construction. Keep imperative work in event or lifecycle callbacks.
func(*native.Node)View sourceStyleany—
Reusable layout, typography, color, and interaction-state styles. Build with ui.Style() and compose with Merge.
anyView sourceChildrenPartChildren—
Content mounted inside the component. Compound child callbacks run after the parent context exists.
PartChildrenView sourceDisabledany—
Prevents activation and exposes the disabled state to accessibility. Compound parts inherit a disabled root.
anyView sourceRolestring—
FocusOnPointerany—
Groupany—
AriaLabelany—
Accessible name, especially for icon-only controls or controls without a visible label.
anyView sourceTabIndex*float64—
Controls sequential keyboard focus order. Omit to retain the component’s default focus behavior.
*float64View sourceOnClickfunc(*native.Event)—
Called after QuickGUI resolves an activation, including supported keyboard activation.
func(*native.Event)View sourceOnDoubleClickfunc(*native.Event)—
Callback for double click. The signature below lists the event payload.
func(*native.Event)View sourceOnContextMenufunc(*native.Event)—
Callback for context menu. The signature below lists the event payload.
func(*native.Event)View sourceOnPointerfunc(*native.Event)—
OnMouseEnterfunc(*native.Event)—
Callback for mouse enter. The signature below lists the event payload.
func(*native.Event)View sourceOnMouseLeavefunc(*native.Event)—
Callback for mouse leave. The signature below lists the event payload.
func(*native.Event)View sourceOnMouseDownfunc(*native.Event)—
OnMouseUpfunc(*native.Event)—
OnKeyDownfunc(*native.Event)—
OnKeyUpfunc(*native.Event)—
OnFocusfunc(*native.Event)—
OnBlurfunc(*native.Event)—
Widthfloat64—
Heightfloat64—
Placementstring—
Gap*float64—
ViewportMargin*float64—
Element
View sourcepart.Child(content).Style(style)Every part returns a fluent element. Strings, numbers, elements, and deferred child factories compose directly.
ChildChild(child any) *Element—
Child appends content and returns this element. Content can be an element, native node, scalar, accessor, or node-returning construction callback.
Child(child any) *ElementView sourceChildrenChildren(children ...any) *Element—
Children appends multiple children in order without replacing existing content. It also accepts []any, []*Element, and []*native.Node slices as arguments. Read the retained child nodes through element.Node.Children.
Children(children ...any) *ElementView sourceStyleStyle(style StyleBuilder) *Element—
Style merges a reusable style. Scalar accessors retain independent native bindings.
Style(style StyleBuilder) *ElementView sourceOnClickOnClick(handler func()) *Element—
OnClick handles a click without an unused event parameter.
OnClick(handler func()) *ElementView sourceRefRef(handler func(*native.Node)) *Element—
Ref exposes the native handle once at this point in the declaration chain.
Ref(handler func(*native.Node)) *ElementView source