Skip to main content
161

Search Lumen

Find components, APIs, guides, and recipes.

GitHub
Apple docs
FeedbackApple

Alert

Present inline native feedback using shared neutral, destructive, success, and warning treatments.

Public APILumenAlertApple / 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 Alert

Use default for neutral notices and semantic variants for outcomes or risk. Keep the message actionable and avoid presenting routine information as an alert.

Alert rendered in the iPhone simulator Lumen playground
Verified runtime captureiPhone simulator
swift
LumenAlert(variant: .success) {
    Text("Profile synced")
}

Reference

Public API

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

APIValues or typeDefaultDescription
variantdefault · destructive · success · warningdefaultSelects the semantic foreground, border, and tint.
contentNative contentRequiredProvides alert content.
SwiftUI modifiersNative layout APIControls placement and sizing.
TextPlatform text compositionReact Native uses explicit text roles because View does not inherit text color.

Native behavior

Design and accessibility

When to use it

Use default for neutral notices and semantic variants for outcomes or risk. Keep the message actionable and avoid presenting routine information as an alert.

Accessibility

An alert is a styled container, not an automatic live announcement. Applications decide when asynchronous content needs a platform announcement.

Shared component

Available on other platforms

React NativeAndroid / Compose
Apple docsSwiftUI package