Skip to main content
239

Search Lumen

Find components, APIs, guides, and recipes.

GitHub
Themes
Apple docs
AIApple

Reasoning

Disclose model reasoning above the answer.

Public APILumenReasoningApple / 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 Vision · visionOS 1+

Native example

Use Reasoning

Set status to streaming while reasoning arrives and complete once the answer starts. A person's toggle always wins.

Reasoning rendered in the iPhone simulator Lumen playground
Captured exampleiPhone simulatorView dark appearance
swift
import LumenUI
import SwiftUI

struct ReasoningExample: View {
    let isThinking: Bool

    var body: some View {
        LumenReasoning(isThinking ? "Thinking…" : "Thought for 12 seconds",
                       status: isThinking ? .streaming : .complete) {
            Text("Checked each platform adapter before answering.")
        }
    }
}
Apple
A disclosure for model reasoning that opens while streaming and closes once when it finishes.

Reference

Public API

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

APIValues or typeDefaultDescription
label / status / collapseOnCompleteheader text / stream status / close after streamingrequired / complete / trueSet status to streaming while reasoning arrives and complete once the answer starts.

Native behavior

Design and accessibility

When to use it

Set status to streaming while reasoning arrives and complete once the answer starts. A person's toggle always wins.

Accessibility

Header button with expanded state; reasoning text is never a live region.

Shared component

Available on other platforms

React NativeAndroid / Compose Web
Apple docsSwiftUI package