Skip to main content
161

Search Lumen

Find components, APIs, guides, and recipes.

GitHub
Apple docs
FeedbackApple

Banner

Present a structured semantic notice with optional actions and dismissal.

Public APILumenBannerApple / SwiftUISwift product: LumenUI

Apple availability

Supported native targets

Import LumenUI in the target that uses this component. iPad support follows the iOS package baseline and uses native iPad layout behavior.

iPhone · iOS 16+iPad · iPadOS 16+Mac · macOS 13+Apple TV · tvOS 16+Apple Vision · visionOS 1+Apple Watch · watchOS 9+

Native example

Use Banner

Use for persistent inline notices with optional action and dismissal. Prefer Alert for compact semantic content without banner structure.

Banner rendered in the iPhone simulator Lumen playground
Verified runtime captureiPhone simulator
swift
LumenBanner(
    "Workspace assigned automatically",
    description: "Moved Safari to Documentation.",
    variant: .accent,
    onDismiss: dismissAssignment
) {
    LumenButton("Undo", intent: .quiet, size: .sm, action: undo)
}

Reference

Public API

The primary shared and platform-specific options exposed by LumenBanner.

APIValues or typeDefaultDescription
titleLocalizedStringKeyRequiredNames the notice.
descriptionLocalizedStringKey?nilAdds supporting detail.
variantdefault · accent · destructive · success · warningdefaultSelects semantic presentation.
onDismiss(() -> Void)?nilAdds a labeled dismiss action.
actions@ViewBuilder () -> ActionsEmptyViewProvides optional inline actions.

Native behavior

Design and accessibility

When to use it

Use for persistent inline notices with optional action and dismissal. Prefer Alert for compact semantic content without banner structure.

Accessibility

A banner is inline content, not a live announcement. The application decides whether newly inserted content needs a platform announcement.

Shared component

Available on other platforms

React NativeAndroid / Compose
Apple docsSwiftUI package