Feedback/DSTooltip
DSTooltip
feedbackSmall informational popover that appears on long-press (iOS) or hover (macOS). Disappears automatically after a timeout.
iOS 17+macOS 14+
Purpose
Explain icon buttons, abbreviations, and non-obvious UI elements without cluttering the layout.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| contentreq | String | — | Tooltip text. |
| position | DSTooltipPosition | .top | .top, .bottom, .leading, .trailing. |
| content (ViewBuilder)req | ViewBuilder | — | The view to attach the tooltip to. |
Examples
Icon button tooltip
Tooltip on an icon-only button.
swift
DSTooltip("Share with team") {
DSIconButton(icon: "square.and.arrow.up", action: share)
}