ThoughtChain Component ๐ โ
Introduction โ
ThoughtChain
is a timeline component used to display AI thinking processes, supporting state management, content expand/collapse, and dynamic style configuration. Through visual thinking step sequences, it helps users intuitively understand complex logical flows. The component has built-in multiple state feedback, transition animations, and extension slots, suitable for intelligent conversations, data analysis, process guidance, and other scenarios.
Code Examples โ
Basic Usage โ
Dot Size Control โ
Max Width Control โ
Custom Title and Content โ
Extension Slots โ
Manual Expand State Control โ
Attributes โ
- Component Attributes
Parameter | Type | Default | Description |
---|---|---|---|
thinkingItems | Array<ThoughtChainItemBase> | [] | Thinking items array |
dotSize | 'small'/'default'/'large' | 'default' | Timeline dot size |
maxWidth | string | '600px' | Maximum width |
lineGradient | boolean | false | Whether to enable line color gradient |
rowKey | string | 'id' | Data item unique identifier field |
titleKey | string | 'title' | Title field name |
thinkTitleKey | string | 'thinkTitle' | Thinking title field name |
thinkContentKey | string | 'thinkContent' | Thinking content field name |
- ThoughtChainItemBase Array item type definition
Parameter | Type | Default | Description |
---|---|---|---|
id | string | number | Required | Node unique identifier |
title | string | undefined | Main title |
thinkTitle | string | undefined | Collapse panel title (thinking title) |
thinkContent | string | undefined | Detailed content displayed when expanded |
status | 'loading' | 'error' | 'success' | undefined | Node status identifier (affects icon and color) |
isCanExpand | boolean | undefined | Whether to allow expanding node content |
isDefaultExpand | boolean | undefined | Whether to expand node content by default |
isMarkdown | boolean | undefined | Whether to enable Markdown format rendering |
typing | TypingConfig | undefined | Typewriter effect configuration (same as typewriter component) |
Events โ
Event Name | Parameter Type | Description |
---|---|---|
handleExpand | item: ThoughtChainItemProps<T> | Triggered when expand state changes |
Slots โ
Slot Name | Scope Parameters | Description |
---|---|---|
#icon | { item } | Custom timeline dot icon |
Core Features โ
Multi-state Visualization
- Supports
loading
/success
/error
- Automatically switches loading animations, icons, and color feedback
- Supports
Dynamic Content Management
- Supports content collapse/expand (configurable default expanded items)
- Built-in typewriter effect (Typewriter component)
- Supports Markdown format rendering
Flexible Style Configuration
- Custom timeline width, dot size
- Dynamic color gradient lines
- CSS variable theme override
Responsive Interaction
- Smooth transition animations
- Supports dynamic addition/deletion of thinking items
- Two-way binding of expand state