Feedback/DSTidbit
DSTidbit
feedbackInline callout card with icon, title, body text, optional button, and dismiss.
iOSmacOS
Purpose
Use for contextual tips, hints, or inline notifications within content. Less intrusive than modals.
Variants
Info
.info
Blue with info icon
Success
.success
Green with checkmark icon
Warning
.warning
Yellow with warning icon
Error
.error
Red with error icon
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| title | String? | nil | Optional title |
| bodyreq | String | โ | Main text content |
| style | DSTidbitStyle | .info | Style: .info, .success, .warning, or .error |
| buttonTitle | String? | nil | Optional button label |
| buttonAction | (() -> Void)? | nil | Optional button action |
| onDismiss | (() -> Void)? | nil | If set, shows close button |
| accessibilityLabel | String? | nil | Optional accessibility label |
Examples
Helpful tip
Inline tip with action button.
swift
DSTidbit(
title: "Pro tip",
body: "Use keyboard shortcuts to work faster.",
style: .info,
buttonTitle: "Learn more",
buttonAction: { showShortcuts() },
onDismiss: { dismissTip() }
)Warning message
Warning without title or actions.
swift
DSTidbit(
body: "Changes will be lost if you navigate away.",
style: .warning
)Usage Guidelines
- Use for contextual, non-blocking messages
- Place near related content for context
- Keep body text concise (1-2 sentences)
- Use dismiss button for optional tips, not critical warnings