Skip to main content
239

Search Lumen

Find components, APIs, guides, and recipes.

GitHub
Themes
React Native docs
AIReact Native

Reasoning

Disclose model reasoning above the answer.

Public APILumenReasoningReact Native

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 Expo web renderer Lumen playground

Captured exampleExpo web renderer

Open interactive preview
Open the Reasoning demo
tsx
import { LumenReasoning, type LumenStreamStatus } from '@santi020k/lumen-react-native'

export function ModelThoughts({ status, seconds, text }: { status: LumenStreamStatus; seconds: number; text: string }) {
  return (
    <LumenReasoning label={status === 'streaming' ? 'Thinking…' : `Thought for ${seconds} seconds`} status={status}>
      {text}
    </LumenReasoning>
  )
}
React Native
Reasoning that opens while the model thinks and closes once the answer starts, unless the person toggled it.

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

Apple / SwiftUIAndroid / Compose Web
React Native docsNative primitives