Feedback/DSNoticeBar
DSNoticeBar
feedbackBanner notice with icon, title, optional message, link, and dismiss button.
iOSmacOS
Purpose
Use for persistent notifications, announcements, or contextual messages at the top of screens.
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 |
|---|---|---|---|
| style | DSNoticeBarStyle | .info | Style: .info, .success, .warning, or .error |
| icon | String? | nil | Optional SF Symbol (defaults to style icon) |
| titlereq | String | โ | Notice title |
| message | String? | nil | Optional body text |
| linkText | String? | nil | Optional action link text |
| linkAction | (() -> Void)? | nil | Action for link tap |
| onDismiss | (() -> Void)? | nil | If set, shows close button |
Examples
Update notice
Announcement with action link.
swift
DSNoticeBar(
style: .info,
title: "New version available",
message: "Update now to get the latest features.",
linkText: "Update",
linkAction: { updateApp() },
onDismiss: { hideNotice() }
)Warning banner
Warning notice without dismiss.
swift
DSNoticeBar(
style: .warning,
title: "Maintenance scheduled",
message: "Service will be unavailable on Sunday 2-4 AM."
)Usage Guidelines
- Use at top of screen or section for visibility
- Include dismiss button for non-critical notices
- Keep title short and message concise
- Use appropriate style for message severity