Skip to main content
161

Search Lumen

Find components, APIs, guides, and recipes.

GitHub
Apple docs
FeedbackApple

Error state

Explain an unavailable region or page and offer application-owned recovery.

Public APILumenErrorStateApple / 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 Error state

Use when a region or page cannot show its primary content. Keep retry and request policy in application state; use Banner when existing content remains useful.

Error state rendered in the iPhone simulator Lumen playground
Verified runtime captureiPhone simulator
swift
LumenErrorState(
    "Could not load projects",
    description: "Check your connection and try again.",
    kind: .offline,
    reference: "REQ-4F82"
) {
    LumenButton("Try again", action: retry)
}

Reference

Public API

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

APIValues or typeDefaultDescription
titleLocalizedStringKeyRequiredNames the unavailable content or failed operation.
kindLumenErrorStateKinderrorSelects error or offline context and its default illustration.
layoutLumenErrorStateLayoutdefaultAdapts spacing and whether the state fills its available page height.
referenceString?nilShows a safe support reference without exposing technical details.
actions@ViewBuilder () -> ActionsEmptyViewProvides application-owned recovery actions.

Native behavior

Design and accessibility

When to use it

Use when a region or page cannot show its primary content. Keep retry and request policy in application state; use Banner when existing content remains useful.

Accessibility

The title is a heading, recovery actions retain native focus order, and React Native and Compose expose configurable live-region behavior.

Shared component

Available on other platforms

React NativeAndroid / Compose
Apple docsSwiftUI package