Skip to content

AiThoughtChain

AiThoughtChain visualizes the reasoning steps of an AI model. It supports single-node and multi-node timeline modes, with drag-and-drop reordering, per-node progress, and Markdown-powered text rendering.

Basic Usage

Single node mode, similar to AiThinking but with a side border. Great for inline reasoning blocks.

Analyzing code...
Thinking complete
Basic Usage

Multi-node Timeline & Progress (Smooth Animation)

When you pass an items list, the component switches to timeline mode and renders each reasoning step in order. You can attach status and progress to each node and show an aggregated progress bar at the top.

TIP

Smooth Interaction: The component features a built-in smooth expand/collapse animation powered by CSS Grid. When you click a node to toggle its details, the content area slides naturally without jarring layout shifts.

Analysis25%
Context Search50%
Generation75%
Verification90%
Timeline Mode

Editable & Draggable Nodes

Enable draggable and editable to support drag-and-drop reordering, deleting steps, and inserting new steps. Node content is rendered with Markdown by default to better express complex reasoning.

Analysis25%
Context Search50%
Generation75%
Verification90%
Add Step
Editable Thought Chain

Events & Interaction

With editing and drag features enabled, you can react to user actions via events and keep external state in sync:

Analysis25%
Context Search50%
Generation75%
Verification90%
Add Step
Interaction Events

Nuxt Support

Thought chain interactions are fully Nuxt 3/4 SSR compatible. Component state hydration is handled at mount.

For more information, see Nuxt Integration Guide.

API

Props

NameDescriptionTypeDefault
titleTitle (single-node mode)string
contentContent (single-node mode)string
statusOverall status (works with both single and multi-node modes)'thinking' | 'loading' | 'success' | 'complete' | 'error' | 'none''none'
itemsReasoning steps; enables timeline mode when providedAiThoughtItem[][]
autoCollapseAuto-collapse single-node content once status becomes donebooleantrue
dot-sizeNode dot size'small' | 'default' | 'large''default'
line-gradientWhether the vertical line uses a gradientbooleanfalse
show-progressWhether to show a global progress bar on topbooleanfalse
draggableEnable drag-and-drop reordering of stepsbooleanfalse
editableEnable node operations (add / delete), usually with dragbooleanfalse
markdownRender content / description using Markdownbooleantrue
theme-overridesInstance-level theme overrides (from @yh-ui/theme)ComponentThemeVars

AiThoughtItem Structure

NameDescriptionType
titleStep titlestring
content / descriptionDetailed step textstring
statusStep statusAiThoughtStatus
expandedWhether details are expanded by defaultboolean
iconCustom icon namestring
idUnique identifier for drag / updatesstring
extraExtra business payloadRecord<string, unknown>
progressStep progress percentage 0-100number
clickableWhether the step content is clickableboolean

Events

NameDescriptionPayload
update:itemsFired when the items list is updated(items: AiThoughtItem[])
node-clickFired when a node content is clicked(item: AiThoughtItem, index: number)
node-deleteFired when the delete button is used(item: AiThoughtItem, index: number)
node-addFired when a new node is requested(index: number)
reorderFired after drag-and-drop reordering(items: AiThoughtItem[])

Slots

NameDescription
defaultCustom content for single-node use

Theme Variables

AiThoughtChain is deeply integrated with the design system:

AI ThoughtChain CSS Variables

Variable NameDefault Value
--yh-ai-thought-chain-line-colorvar(--yh-border-color-lighter)
--yh-ai-thought-chain-active-colorvar(--yh-color-primary)

Released under the MIT License.