Hulian UIv0.93.5413 components0 components
  • Start
  • Components
  • Blocks
  • Pages
  • Demos
  • Changelog
ChineseEnglish
  • ComponentsComponents
  • ThemeTheme

Conversation

  • Conversation
  • ChatMessage
  • PromptInput
  • TypingDots

Reasoning and Tools

  • ThinkingBlock
  • ToolCall
  • AgentPlan
  • Dossier
  • Artifact
  • ConfirmCard
  • ThreadList
  • TaskRunner

Assistance

  • StreamingText
  • PromptSuggestions
  • MessageActions
  • Citation

ThinkingBlock

thinking-block

Reveals or collapses an agent reasoning trace with active and completed states.

Usage

Basic usage

Completed reasoning: Click on the head to expand/collapse the thought chain.

tsx
<ThinkingBlock duration="Thinking 3s">
  {reasoning}
</ThinkingBlock>

Thinking

When thinking, the title rotates + the highlight flows, and is expanded by default.

The user should make the homepage 100% dogfood. First look at what components are used in the existing page.tsx, then check what replaceable typesetting/layout primitives are in the library, and finally replace them block by block and fill the gaps.
tsx
<ThinkingBlock thinking>
  {reasoning}
</ThinkingBlock>

Custom title

title overrides the default "Thinking Process", duration marks time-consuming.

tsx
<ThinkingBlock title="Planning task disassembly" duration="2.4s">
  {reasoning}
</ThinkingBlock>

Expand by default

defaultOpen Make completed blocks also expand the text by default.

The user should make the homepage 100% dogfood. First look at what components are used in the existing page.tsx, then check what replaceable typesetting/layout primitives are in the library, and finally replace them block by block and fill the gaps.
tsx
<ThinkingBlock defaultOpen duration="Thinking 1s">
  {reasoning}
</ThinkingBlock>

When to Use

Use it to disclose a concise, user-facing reasoning summary or progress narrative. The header is highlighted while work is in progress and can collapse after completion. Use AgentPlan for structured steps or ToolCall for one tool invocation.

Import

ts
import { ThinkingBlock } from "@hulianui/ui"

Props

NameTypeDefaultDescription
thinkingbooleanfalseActive state with a spinner and highlight; also supplies the default expanded state
defaultOpenbooleanWith thinkingUncontrolled initial expansion state
openboolean-Controlled expansion state
classNamestring-Container class name

Events

EventTypeDescription
onOpenChange(open: boolean) => voidCalled when the expanded state changes

Slots

SlotTypeDescription
titleReactNodeHeader title; defaults to \u601d\u8003\u8fc7\u7a0b ("Thinking process")
durationReactNodeMuted duration label beside the title, such as "Thought for 3s"
childrenReactNodeReasoning or progress content; wrap rendered Markdown in <Prose />

Usage Guidelines

  • Choose either controlled or uncontrolled state. Pair open with onOpenChange; use defaultOpen only to set the initial uncontrolled value.
  • When defaultOpen/open is not passed, the expanded state defaults to thinking (expanded during thinking, collapsed after completion).

Related

ToolCall · AgentPlan · Dossier · Artifact · ConfirmCard · ThreadList

Playground

<ThinkingBlock>{reasoning}</ThinkingBlock>
PreviousTypingDotsAI AgentsNextToolCall

On this page

  • Usage
  • Documentation
    • When to Use
    • Import
    • Props
    • Events
    • Slots
    • Usage Guidelines
    • Related
  • Playground