Skip to content

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.Root
  • systemPopover.Trigger
  • systemPopover.Content

#API reference

Expand an entry for its description and complete signature. A dash means no declaration default is documented.

NewSystemPopover

View source
ui.NewSystemPopover(props ...PopoverRootProps) *SystemPopoverComponent

NewSystemPopover declares a SystemPopover instance. Optional props provide initial settings.

ChildrenComponent—

Content mounted inside the component. Compound child callbacks run after the parent context exists.

Component
View source
Openfunc() bool—

Controlled visibility of the panel or overlay. Pair with the open-change callback.

func() bool
View source
DefaultOpenbool—

Initial visibility when the component owns its open state.

bool
View source
OnOpenChangefunc(bool, PopoverOpenChangeDetails)—

Reports a requested visibility change, including dismissal.

func(bool, PopoverOpenChangeDetails)
View source
DismissOnEscape*bool—

Allows Escape to dismiss the surface.

*bool
View source
DismissOnPointerOutside*bool—

Allows a pointer press outside the surface to dismiss it.

*bool
View source
Modal*bool—

Contains focus and blocks interaction behind the surface.

*bool
View source
OpenOnHover*bool—

Opens the surface when its trigger is hovered.

*bool
View source
Delayany—

Core-owned delay in milliseconds before opening.

any
View source
CloseDelayany—

Core-owned delay in milliseconds before closing.

any
View source
OnPlacementChangefunc(AnchorPlacementDetails, *native.Event)—

Callback for placement change. The signature below lists the event payload.

func(AnchorPlacementDetails, *native.Event)
View source
SidePopoverSide—

Preferred placement side before collision handling.

PopoverSide
View source
AlignPopoverAlign—

Preferred alignment on the placement cross-axis.

PopoverAlign
View source
SideOffset*float64—

Distance from the anchor on the chosen side, in logical pixels.

*float64
View source
AlignOffset*float64—

Offset along the anchor’s cross axis, in logical pixels.

*float64
View source
CollisionPadding*float64—

Space reserved between the positioned surface and the available viewport edges.

*float64
View source
Sticky*bool—

Keeps the positioned surface attached to its anchor within available bounds.

*bool
View source
Anchor*native.Node—

Element used as the placement anchor for this surface.

*native.Node
View source

SystemPopover.Open

View source
systemPopover.Open(value any) *SystemPopoverComponent

Controlled visibility of the panel or overlay. Pair with the open-change callback.

SystemPopover.DefaultOpen

View source
systemPopover.DefaultOpen(value bool) *SystemPopoverComponent

Initial visibility when the component owns its open state.

SystemPopover.OnOpenChange

View source
systemPopover.OnOpenChange(value func(bool, PopoverOpenChangeDetails)) *SystemPopoverComponent

Reports a requested visibility change, including dismissal.

SystemPopover.DismissOnEscape

View source
systemPopover.DismissOnEscape(value bool) *SystemPopoverComponent

Allows Escape to dismiss the surface.

SystemPopover.DismissOnPointerOutside

View source
systemPopover.DismissOnPointerOutside(value bool) *SystemPopoverComponent

Allows a pointer press outside the surface to dismiss it.

SystemPopover.Modal

View source
systemPopover.Modal(value bool) *SystemPopoverComponent

Contains focus and blocks interaction behind the surface.

SystemPopover.OpenOnHover

View source
systemPopover.OpenOnHover(value bool) *SystemPopoverComponent

Opens the surface when its trigger is hovered.

SystemPopover.Delay

View source
systemPopover.Delay(value any) *SystemPopoverComponent

Core-owned delay in milliseconds before opening.

SystemPopover.CloseDelay

View source
systemPopover.CloseDelay(value any) *SystemPopoverComponent

Core-owned delay in milliseconds before closing.

SystemPopover.OnPlacementChange

View source
systemPopover.OnPlacementChange(value func(AnchorPlacementDetails, *native.Event)) *SystemPopoverComponent

Callback for placement change. The signature below lists the event payload.

SystemPopover.Side

View source
systemPopover.Side(value PopoverSide) *SystemPopoverComponent

Preferred placement side before collision handling.

SystemPopover.Align

View source
systemPopover.Align(value PopoverAlign) *SystemPopoverComponent

Preferred alignment on the placement cross-axis.

SystemPopover.SideOffset

View source
systemPopover.SideOffset(value float64) *SystemPopoverComponent

Distance from the anchor on the chosen side, in logical pixels.

SystemPopover.AlignOffset

View source
systemPopover.AlignOffset(value float64) *SystemPopoverComponent

Offset along the anchor’s cross axis, in logical pixels.

SystemPopover.CollisionPadding

View source
systemPopover.CollisionPadding(value float64) *SystemPopoverComponent

Space reserved between the positioned surface and the available viewport edges.

SystemPopover.Sticky

View source
systemPopover.Sticky(value bool) *SystemPopoverComponent

Keeps the positioned surface attached to its anchor within available bounds.

SystemPopover.Anchor

View source
systemPopover.Anchor(value *native.Node) *SystemPopoverComponent

Element used as the placement anchor for this surface.

SystemPopover.Root

View source
systemPopover.Root() *Element

Configures root for this part. The declared type and source define the accepted value.

SystemPopover.Trigger

View source
systemPopover.Trigger(options ...PopoverTriggerProps) *Element

Configures 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 source
Styleany—

Reusable layout, typography, color, and interaction-state styles. Build with ui.Style() and compose with Merge.

any
View source
ChildrenPartChildren—

Content mounted inside the component. Compound child callbacks run after the parent context exists.

PartChildren
View source
Disabledany—

Prevents activation and exposes the disabled state to accessibility. Compound parts inherit a disabled root.

any
View source
Rolestring—

Accessibility role override. Prefer the component’s built-in semantics.

string
View source
FocusOnPointerany—

Whether a pointer press moves keyboard focus to the control.

any
View source
Groupany—

Names this element as a group for descendant interaction-state styling.

any
View source
AriaLabelany—

Accessible name, especially for icon-only controls or controls without a visible label.

any
View source
TabIndex*float64—

Controls sequential keyboard focus order. Omit to retain the component’s default focus behavior.

*float64
View source
OnClickfunc(*native.Event)—

Called after QuickGUI resolves an activation, including supported keyboard activation.

func(*native.Event)
View source
OnDoubleClickfunc(*native.Event)—

Callback for double click. The signature below lists the event payload.

func(*native.Event)
View source
OnContextMenufunc(*native.Event)—

Callback for context menu. The signature below lists the event payload.

func(*native.Event)
View source
OnPointerfunc(*native.Event)—

Callback for pointer. The signature below lists the event payload.

func(*native.Event)
View source
OnMouseEnterfunc(*native.Event)—

Callback for mouse enter. The signature below lists the event payload.

func(*native.Event)
View source
OnMouseLeavefunc(*native.Event)—

Callback for mouse leave. The signature below lists the event payload.

func(*native.Event)
View source
OnMouseDownfunc(*native.Event)—

Callback for mouse down. The signature below lists the event payload.

func(*native.Event)
View source
OnMouseUpfunc(*native.Event)—

Callback for mouse up. The signature below lists the event payload.

func(*native.Event)
View source
OnKeyDownfunc(*native.Event)—

Callback for key down. The signature below lists the event payload.

func(*native.Event)
View source
OnKeyUpfunc(*native.Event)—

Callback for key up. The signature below lists the event payload.

func(*native.Event)
View source
OnFocusfunc(*native.Event)—

Callback for focus. The signature below lists the event payload.

func(*native.Event)
View source
OnBlurfunc(*native.Event)—

Callback for blur. The signature below lists the event payload.

func(*native.Event)
View source
OpenOnHover*bool—

Opens the surface when its trigger is hovered.

*bool
View source
Delayany—

Core-owned delay in milliseconds before opening.

any
View source
CloseDelayany—

Core-owned delay in milliseconds before closing.

any
View source

SystemPopover.Content

View source
systemPopover.Content(options ...PopoverContentProps) *Element

Configures 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 source
Styleany—

Reusable layout, typography, color, and interaction-state styles. Build with ui.Style() and compose with Merge.

any
View source
ChildrenPartChildren—

Content mounted inside the component. Compound child callbacks run after the parent context exists.

PartChildren
View source
Disabledany—

Prevents activation and exposes the disabled state to accessibility. Compound parts inherit a disabled root.

any
View source
Rolestring—

Accessibility role override. Prefer the component’s built-in semantics.

string
View source
FocusOnPointerany—

Whether a pointer press moves keyboard focus to the control.

any
View source
Groupany—

Names this element as a group for descendant interaction-state styling.

any
View source
AriaLabelany—

Accessible name, especially for icon-only controls or controls without a visible label.

any
View source
TabIndex*float64—

Controls sequential keyboard focus order. Omit to retain the component’s default focus behavior.

*float64
View source
OnClickfunc(*native.Event)—

Called after QuickGUI resolves an activation, including supported keyboard activation.

func(*native.Event)
View source
OnDoubleClickfunc(*native.Event)—

Callback for double click. The signature below lists the event payload.

func(*native.Event)
View source
OnContextMenufunc(*native.Event)—

Callback for context menu. The signature below lists the event payload.

func(*native.Event)
View source
OnPointerfunc(*native.Event)—

Callback for pointer. The signature below lists the event payload.

func(*native.Event)
View source
OnMouseEnterfunc(*native.Event)—

Callback for mouse enter. The signature below lists the event payload.

func(*native.Event)
View source
OnMouseLeavefunc(*native.Event)—

Callback for mouse leave. The signature below lists the event payload.

func(*native.Event)
View source
OnMouseDownfunc(*native.Event)—

Callback for mouse down. The signature below lists the event payload.

func(*native.Event)
View source
OnMouseUpfunc(*native.Event)—

Callback for mouse up. The signature below lists the event payload.

func(*native.Event)
View source
OnKeyDownfunc(*native.Event)—

Callback for key down. The signature below lists the event payload.

func(*native.Event)
View source
OnKeyUpfunc(*native.Event)—

Callback for key up. The signature below lists the event payload.

func(*native.Event)
View source
OnFocusfunc(*native.Event)—

Callback for focus. The signature below lists the event payload.

func(*native.Event)
View source
OnBlurfunc(*native.Event)—

Callback for blur. The signature below lists the event payload.

func(*native.Event)
View source
Widthfloat64—

Declared logical width.

float64
View source
Heightfloat64—

Declared logical height.

float64
View source
Placementstring—

Requested native child-window placement.

string
View source
Gap*float64—

Space between adjacent children, in logical pixels.

*float64
View source
ViewportMargin*float64—

Minimum space reserved around the surface within the viewport.

*float64
View source
part.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) *Element
View source
ChildrenChildren(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) *Element
View source
StyleStyle(style StyleBuilder) *Element—

Style merges a reusable style. Scalar accessors retain independent native bindings.

Style(style StyleBuilder) *Element
View source
OnClickOnClick(handler func()) *Element—

OnClick handles a click without an unused event parameter.

OnClick(handler func()) *Element
View source
RefRef(handler func(*native.Node)) *Element—

Ref exposes the native handle once at this point in the declaration chain.

Ref(handler func(*native.Node)) *Element
View source