Popover
Presents a native SwiftUI popover from a composed SwiftUI trigger.
#Import
Import ui from github.com/egoist/quickgui/go/ui.
import (
"github.com/egoist/quickgui/go/ui"
)#Usage
func SwiftUiPopoverExample() *native.Node {
open, setOpen := ui.CreateSignal(false)
return ui.SwiftUI.Host(
ui.SwiftUIHostProps{MatchContents: true},
func() *native.Node {
return ui.SwiftUI.Popover.Root(
ui.SwiftUIPopoverProps{
IsPresented: open,
OnIsPresentedChange: setOpen,
},
func() *native.Node {
return ui.Fragment([]*native.Node{ui.SwiftUI.Popover.Trigger(ui.SwiftUIPopoverTriggerProps{Render: func() *native.Node { return ui.SwiftUI.Button(ui.SwiftUIButtonProps{Label: "Account"}) }}),
ui.SwiftUI.Popover.Content(
ui.SwiftUIPopoverContentProps{},
func() *native.Node {
return ui.SwiftUI.QuickGUIHostView(
ui.SwiftUIQuickGUIHostViewProps{Width: 240, Height: 120},
"Account settings",
)
},
)})
},
)
},
)
}#Anatomy
ui.SwiftUI.Popover.Triggerui.SwiftUI.Popover.Content
#API reference
Expand an entry for its description and complete signature. A dash means no declaration default is documented.
SwiftUIPopover.Root
View sourceui.SwiftUIPopover.Root(props SwiftUIPopoverProps, children ...any) *native.NodeTestIDany—
Modifiersany—
Reffunc(*native.Node)—
Receives the retained native node after construction. Keep imperative work in event or lifecycle callbacks.
func(*native.Node)View sourceChildrenComponent—
Content mounted inside the component. Compound child callbacks run after the parent context exists.
ComponentView sourceIsPresentedany—
OnIsPresentedChangefunc(bool)—
AttachmentAnchorstring—
ArrowEdgestring—
SwiftUIPopover.Trigger
View sourceui.SwiftUIPopover.Trigger(props SwiftUIPopoverTriggerProps) *native.NodeRenderComponent—
OnPressfunc(*native.Event)—
Reffunc(*native.Node)—
Receives the retained native node after construction. Keep imperative work in event or lifecycle callbacks.
func(*native.Node)View sourceSwiftUIPopover.Content
View sourceui.SwiftUIPopover.Content(props SwiftUIPopoverContentProps, children ...any) *native.NodeChildrenComponent—
Content mounted inside the component. Compound child callbacks run after the parent context exists.
ComponentView sourceReffunc(*native.Node)—
Receives the retained native node after construction. Keep imperative work in event or lifecycle callbacks.
func(*native.Node)View source