# Thinking Block

Collapsible block for displaying extended thinking / reasoning content from an AI model



<ComponentPreview base="opentui" name="thinking-block-demo" />

Installation [#installation]

<CodeTabs>
  <TabsList>
    <TabsTrigger value="cli">
      Command
    </TabsTrigger>

    <TabsTrigger value="manual">
      Manual
    </TabsTrigger>
  </TabsList>

  <TabsContent value="cli">
    ```bash
    npx shadcn@latest add @termcn/opentui-thinking-block
    ```
  </TabsContent>

  <TabsContent value="manual">
    <Steps>
      <Step>
        Copy and paste the following code into your project.
      </Step>

      <ComponentSource base="opentui" name="thinking-block" title="components/ui/thinking-block.tsx" />

      <Step>
        Update the import paths to match your project setup.
      </Step>
    </Steps>
  </TabsContent>
</CodeTabs>

Usage [#usage]

```tsx
import { ThinkingBlock } from "@/components/ui/thinking-block";
```

```tsx
<ThinkingBlock
  content="The user wants to refactor the function. I should split it into smaller helpers..."
  tokenCount={1284}
  duration={3200}
/>
```

API Reference [#api-reference]

ThinkingBlock [#thinkingblock]

| Prop               | Type      | Default       |
| ------------------ | --------- | ------------- |
| `content`          | `string`  | `required`    |
| `streaming`        | `boolean` | `false`       |
| `defaultCollapsed` | `boolean` | `true`        |
| `label`            | `string`  | `"Reasoning"` |
| `tokenCount`       | `number`  | -             |
| `duration`         | `number`  | -             |
