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.

Interactive Reference

Live showroom

Need the full visual surface?

Screenshots do not scale well across every component, state, and variant. For the real interactive reference, import the package and launch DSShowcaseRoot().

Best for exploring:

variants, states, categories, and real app examples in one place.

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