Skip to main content
239

Search Lumen

Find components, APIs, guides, and recipes.

GitHub
Themes
Android docs
AIAndroid

Reasoning

Disclose model reasoning above the answer.

Public APILumenReasoningAndroid / Compose

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 Android phone emulator Lumen playground
Captured exampleAndroid phone emulatorView dark appearance
kotlin
import androidx.compose.material3.Text
import androidx.compose.runtime.*
import com.santi020k.lumen.*

@Composable
fun ReasoningExample(thinking: Boolean) {
    LumenReasoning(
        label = if (thinking) "Thinking…" else "Thought for 12 seconds",
        status = if (thinking) LumenStreamStatus.Streaming else LumenStreamStatus.Complete
    ) {
        Text("The person wants a short summary, so I'll lead with the new components.")
    }
}
Android
A disclosure for the model's reasoning that opens while streaming, closes once when streaming ends, and leaves the person's own choice alone.

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 NativeApple / SwiftUI Web
Android docsCompose module