N
Nyxis
Reasoning

ReasoningTrace

Collapsible disclosure for the model's extended-thinking output, with live streaming.

Preview

Installation

pnpm add nyxis-ui

Usage

import { ReasoningTrace } from 'nyxis-ui';
// or, for stricter tree-shaking:
// import { ReasoningTrace } from 'nyxis-ui/reasoning-trace';

<ReasoningTrace
  text={extendedThinking}
  streaming={isThinking}
  durationMs={elapsed}
  summary="3 key reasons + concrete install snippet"
/>;

Why a separate component?

Extended-thinking output is conceptually distinct from the assistant’s response:

  • It’s verbose — collapsing keeps the conversation surface clean.
  • It’s typically rendered in an italic, muted style to signal “internal”.
  • It often arrives before the visible response — the streaming state is independent.

Use this component when the provider returns thinking/reasoning content separately (Anthropic extended thinking, OpenAI o1 reasoning, etc.).

Props

PropTypeDefault
textstringReasoning content streamed so far.
streamingbooleanfalseAdds the trailing cursor + “thinking” badge.
defaultOpenbooleanfalseRender expanded on first paint.
durationMsnumberTime taken to think; shown after completion.
summarystringOne-line summary shown when collapsed.
labelstring"Reasoning"Header label.