overlays/DSPopover
DSPopover
overlaysAnchored 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
| Prop | Type | Default | Description |
|---|---|---|---|
| isPresentedreq | Binding<Bool> | — | Controls visibility. |
| arrowEdge | Edge | .top | Which edge of the anchor the arrow points from. |
| contentreq | ViewBuilder | — | Popover content. |
| anchor (ViewBuilder)req | ViewBuilder | — | The 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() }
}