When to use it
Render one viewport at the app root and show toasts through its queue. Keep messages short and actions optional.
Stack timed notifications above the app inside the safe area.
Apple availability
Import LumenUI in the target that uses this component. iPad support follows the iOS package baseline and uses native iPad layout behavior.
Native example
Render one viewport at the app root and show toasts through its queue. Keep messages short and actions optional.
import LumenUI
import SwiftUI
struct SyncScreen: View {
@StateObject private var toasts = LumenToastQueue()
var body: some View {
VStack(spacing: LumenSpacing.md) {
LumenButton("Save") {
toasts.show("Changes saved", description: "Your edits are live.", variant: .success)
}
LumenButton("Pause sync", intent: .outline) {
toasts.show("Sync paused", variant: .warning, duration: 0,
action: LumenToastAction("Resume") {
toasts.show("Sync resumed", variant: .success)
})
}
}
.frame(maxWidth: .infinity, maxHeight: .infinity)
.lumenToastViewport(toasts, placement: .bottomRight)
}
}Reference
The primary shared and platform-specific options exposed by LumenToastViewport.
| API | Values or type | Default | Description |
|---|---|---|---|
| placement / maxCount / duration | screen edge / visible toasts / auto-dismiss | bottom-center / 3 / 5000 ms | Render one viewport at the app root and show toasts through its queue. |
Native behavior
Render one viewport at the app root and show toasts through its queue. Keep messages short and actions optional.
Toasts announce by tone, pause while touched, and keep a named dismiss button.
Shared component