AurumBannerHost
Aurum's banner host — a thin slot that renders the single currently visible AurumBanner from hostState with a slide-from-top expand/collapse animation.
| family | Feedback |
|---|---|
| platform | iOS 17+ · SwiftUI |
| source | Sources/Aurum/Component/Feedback/AurumBannerHost.swift |
Aurum's banner host — a thin slot that renders the single currently
visible AurumBanner from hostState with a slide-from-top
expand/collapse animation.
Place at the top of the screen (above the header / content). Placed
in the layout flow (first child of the root VStack), the animation
smoothly pushes the content underneath down and releases it back — the
structural-band behaviour. Placed in an .overlay(alignment: .top) it
floats over content instead. Banners are persistent — there is no queue
or timer; the caller owns the lifecycle.
This is codebase-only — there is no Figma node yet. It is
proposal-grade orchestration glue, pending design; reconcile when design
produces the spec. The visual is AurumBanner.
Intended use
Host slot for persistent, top-anchored, app- or page-level status: offline / no-connection, scheduled downtime, degraded service, account warnings. One host per screen, placed top-anchored. When the host touches the top screen edge the banner's tone colour bleeds under the status bar automatically while content stays clear.
Do
- Place the host top-anchored, above the header / content, so the strip reads as a structural band at the top edge.
- Place the host in the layout flow (first child of the root
VStack) when the banner should push content down rather than float over it. - Drive
show(...)/dismiss()from the source of truth for the condition (e.g. a connectivity observer), so the banner mirrors live state.
Don’t
- Use this for transient confirmations — that's
AurumToastHost+showToast(...). - Mount more than one
AurumBannerHostper screen — concurrent hosts fight for the top slot. - Give the host a fixed height — it occupies only the banner's natural height; anchor it with layout position, not frames.