AurumBanner
Aurum's banner primitive — a persistent, top-anchored, full-bleed tonal status strip.
| family | Feedback |
|---|---|
| platform | iOS 17+ · SwiftUI |
| source | Sources/Aurum/Component/Feedback/AurumBanner.swift |
| snapshots | 1 baselines · iPhone 17 Pro · iOS 26.5 |
Aurum's banner primitive — a persistent, top-anchored, full-bleed tonal
status strip. The SwiftUI port of aurum-android's AurumBanner. It is
the persistent counterpart of the transient AurumToast: same tonal
palette and status glyphs, but structural (square corners, full-bleed, a
bottom hairline) rather than a floating rounded pill, and it stays until
the caller dismisses it.
Each tone pairs a feedback.* subtle background with the matching
intense content colour and a per-tone leading status glyph. An opaque
bgPageBase base is painted under the tint so the strip reads solid
over any backdrop. Optionally renders a single inline text action
(e.g. "Retry") and, when onDismiss is non-nil, a trailing close ✕.
When the banner touches the top screen edge its backgrounds bleed under
the status bar automatically (SwiftUI background extends into safe
areas) while the content stays clear — the equivalent of Android's
windowInsets parameter, with no parameter needed.
This is a presentational primitive — it does not own the show/hide
lifecycle. Pair it with caller-owned state (or AurumBannerHost).
Intended use
Use for persistent, top-anchored, app- or page-level status the user must stay aware of — offline / no-connection, scheduled downtime, degraded service, account warnings (KYC pending, payment failed). The persistent counterpart to the transient AurumToast: pick the tone from semantic intent. For ephemeral confirmations use AurumToast; for modal / destructive flows use AurumBottomSheet.
Do
- Use for persistent state the user must stay aware of, and pick
tonefrom semantic intent — error for failures, warning for at-risk state, info for neutral context, success for resolved state, brand for product moments, neutral for low-urgency system status. - Pair a single
actiononly when there is a clear recovery path (e.g. "Retry", "Verify now"); leave itnilfor pure status. - Set
onDismissfor advisory banners the user can clear; leave itnilfor state banners that must persist until the underlying condition resolves.
Don’t
- Use for transient confirmations like "Saved" or "Copied" — that's
AurumToast. - Stack multiple banners — show one at a time so the top-anchored slot stays a single, clear signal.
- Clip the strip or give it rounded corners — the banner is a structural full-bleed band, not a floating card.
Snapshots
Recorded on the pinned simulator — iPhone 17 Pro · iOS 26.5 · Xcode 26.6.