/
1.1k
Sponsor

Thinking Block

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

Terminal

Installation

$ pnpm dlx shadcn@latest add @termcn/ink/thinking-block

Usage

import { ThinkingBlock } from "@/components/ui/thinking-block";
<ThinkingBlock
  content="The user wants to refactor the function. I should split it into smaller helpers..."
  tokenCount={1284}
  duration={3200}
/>

API Reference

ThinkingBlock

PropTypeDefault
contentstringrequired
streamingbooleanfalse
defaultCollapsedbooleantrue
labelstring"Reasoning"
tokenCountnumber-
durationnumber-

Notes

Accessibility

termcn exposes the following behavior through Ink's terminal accessibility APIs. This is not a browser ARIA or general WCAG-conformance claim.

  • Keyboard: Enter / Space activate the focused action when enabled; Escape dismisses or cancels when supported; Tab / Shift+Tab move through Ink focus targets.
  • Focus and composition: Input is active only while the component's focus target is focused, enabled, active, and inside the topmost focus scope.
  • Screen reader: Screen-reader mode removes decorative output while preserving meaningful labels and state.