overlays/DSPopover

DSPopover

overlays
since v2.0

Anchored floating panel with an arrow pointing to its trigger. Contains rich content — not just text.

iOS 17+macOS 14+

Purpose

Action menus, rich tooltips, user profile previews, and mini-forms.

Props

PropTypeDefaultDescription
isPresentedreqBinding<Bool>Controls visibility.
arrowEdgeEdge.topWhich edge of the anchor the arrow points from.
contentreqViewBuilderPopover content.
anchor (ViewBuilder)reqViewBuilderThe trigger view.

Examples

User hovercard

Profile popover on avatar tap.

swift
DSPopover(isPresented: $showProfile, arrowEdge: .bottom) {
    UserMiniCard(user: post.author)
} anchor: {
    DSAvatar(initials: post.author.initials, size: .sm)
        .onTapGesture { showProfile.toggle() }
}

Related Components