--- title: Reasoning description: A collapsible "chain of thought" disclosure that tracks streaming duration and splits text into labelled sections. source: reasoning.tsx --- ## Usage guidelines - **Chain-of-thought disclosure** — a collapsible block for a model's thinking. - **Live label** — shimmers "Thinking…" while streaming and settles to "Thought for Ns" when it stops; the duration is tracked for you. - **Sectioned content** — bold `**Header**` lines split the text into labelled sections, rendered as markdown. - **State via `useReasoning`** — read streaming, open, and duration from anywhere inside. - **Get started** — see [Installation](/docs/installation) to add the package and copy the component. ## Anatomy ```tsx {reasoningText} ``` Driven from a streaming message, passing the reasoning parts' text: ```tsx {texts} ``` ## useReasoning Read the disclosure state from anywhere inside ``: export const hookMembers = [ { name: "isStreaming", type: "boolean", description: "Whether reasoning is still streaming in." }, { name: "isOpen", type: "boolean", description: "Whether the panel is open." }, { name: "setIsOpen", type: "(open: boolean) => void", description: "Toggle the panel." }, { name: "duration", type: "number | undefined", description: "Tracked streaming duration in seconds." }, ]; ## Accessibility Built on a disclosure: `Reasoning.Trigger` is a `