Now Playing
Attached to the control that opened it — note the anchor arrow.
The bubble with the arrow is an NSPopover — click the button to toggle it
Popover
/ NSPopover · NSPopover.show(relativeTo:of:preferredEdge:) /
also called anchored popover, popover bubble, callout
A popover is a lightweight floating bubble for controls or information related to one specific source view. Its arrow identifies the control that opened it, and AppKit chooses an edge that keeps the bubble onscreen. Depending on its behavior, it can close when the user interacts elsewhere or remain open until dismissed explicitly.
Anatomy — every part, named
- 1Anchor arrow
NSPopover.show(relativeTo:of:preferredEdge:)“The little point on the bubble aimed at the button” is the anchor arrow.
- 2Positioning rect
NSPopover.show(relativeTo:of:preferredEdge:)“The exact bit of the button the bubble attaches to” is the positioning rect.
Prompt — paste into your agent
Present this as a Popover using NSPopover (SwiftUI: View.popover), with a visible anchor arrow aimed at the exact control that opened it. It should remain visually attached to that control and dismiss with native popover behavior.
In code
The exact names this thing goes by in code — each row is one framework’s word for it. Use the row that matches your project (or paste it into your prompt).
| AppKit | NSPopover | |
| AppKit | NSPopover.show(relativeTo:of:preferredEdge:) | positions the popover and its anchor arrow |
| SwiftUI | View.popover(isPresented:attachmentAnchor:arrowEdge:content:) | |
| AppKit | NSPopover.Behavior |