Popover
組み合わせた SwiftUI トリガーから、ネイティブ SwiftUI Popover を表示します。
#インポート
@quickgui/solid/swift-ui から Popover をインポートします。
import { Host, Popover } from "@quickgui/solid/swift-ui";#使い方
<Popover
isPresented={open()}
onIsPresentedChange={setOpen}
attachmentAnchor="bottom"
arrowEdge="top"
>
<Popover.Trigger render={<Button label="Open" />} />
<Popover.Content>
<QuickGUIHostView width={280} height={120}>
<SettingsPanel />
</QuickGUIHostView>
</Popover.Content>
</Popover>#構成
Popover.TriggerPopover.Content
<Popover isPresented={open()} onIsPresentedChange={setOpen}>
<Popover.Trigger render={<Button label="Open" />} />
<Popover.Content>{/* SwiftUI-hosted content */}</Popover.Content>
</Popover>#API リファレンス
項目を展開すると説明と完全なシグネチャが表示されます。ダッシュは宣言に既定値が記載されていないことを示します。
Popover
ソースを見るPopover(props: PopoverProps): NativeNodetestIDstring—
modifiersViewModifier[]—
childrenunknown—
isPresentedboolean—
onIsPresentedChange(isPresented: boolean) => void—
Declares onIsPresentedChange (optional). Reactive JSX expressions update this property in place.
(isPresented: boolean) => voidソースを見るattachmentAnchorPopoverAttachmentAnchor—
Declares attachmentAnchor (optional). Reactive JSX expressions update this property in place.
PopoverAttachmentAnchorソースを見るarrowEdgePopoverArrowEdge—
Declares arrowEdge (optional). Reactive JSX expressions update this property in place.
PopoverArrowEdgeソースを見るref((node: NativeNode) => void) | NativeNode—
Declares ref (optional). Reactive JSX expressions update this property in place.
((node: NativeNode) => void) | NativeNodeソースを見るPopover.Trigger
ソースを見るPopover.Trigger(props: PopoverTriggerProps): NativeNoderenderJSX.Element—
Native SwiftUI component used as the trigger. This follows Base UI's composition shape: Trigger supplies behavior and `render` replaces its default element. The rendered component's own press handler runs before Trigger's behavior.
JSX.Elementソースを見るonPress(event: QuickGuiEvent) => void—
Called after the rendered component's own press handler and before the popover opens.
(event: QuickGuiEvent) => voidソースを見るref(node: NativeNode) => void—
Receives the rendered trigger component rather than the internal structural slot.
(node: NativeNode) => voidソースを見るPopover.Content
ソースを見るPopover.Content(props: PopoverContentProps): NativeNode