Skip to main content
161

Search Lumen

Find components, APIs, guides, and recipes.

GitHub
Apple docs
FeedbackApple

Alert dialog

Request a controlled native confirmation with explicit cancel and confirm states.

Public APIlumenAlertDialogApple / 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 dialog

Use for short consequential confirmations. Keep visibility and mutation state in the application and reserve destructive styling for irreversible or difficult-to-recover actions.

Alert dialog rendered in the iPhone simulator Lumen playground
Verified runtime captureiPhone simulator
swift
content.lumenAlertDialog(
    isPresented: $showConfirmation,
    title: "Delete report?",
    confirmLabel: "Delete",
    confirmRole: .destructive,
    onConfirm: deleteReport
)

Reference

Public API

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

APIValues or typeDefaultDescription
isPresentedBinding<Bool>RequiredControls native modal presentation.
title / descriptionNative localized textDescription optionalExplains the decision.
confirmLabel / cancelLabelNative localized textCancel label: CancelNames both actions.
confirmRoleButtonRole?nilCommunicates whether the confirm action is destructive.
confirmDisabledBoolfalseControls whether the confirm action can be activated.
confirmLoadingBoolfalseCommunicates asynchronous confirmation progress.

Native behavior

Design and accessibility

When to use it

Use for short consequential confirmations. Keep visibility and mutation state in the application and reserve destructive styling for irreversible or difficult-to-recover actions.

Accessibility

Native modal focus stays inside the confirmation surface and cancel and confirm remain independently named actions.

Shared component

Available on other platforms

React NativeAndroid / Compose
Apple docsSwiftUI package