An animated AI reasoning step-by-step thought chain component with collapsible steps and status indicators.
Installation
Usage
How It Works
- Each
ThoughtChainStepaccepts astatusprop:"done","active", or"pending". - Steps are collapsible — clicking the trigger toggles the content open/closed.
- The active step renders its trigger label with a shimmer animation via
ShimmerTextand shows an "In progress" badge. - The done step shows a green checkmark icon; active shows a spinning loader; pending shows a muted circle.
ThoughtChainContentusesAnimatePresencefor smooth height-animated expand/collapse transitions.ThoughtChainItementries animate in with a fade + slide from above.ThoughtChainautomatically injects_isLastinto the last child step to allow conditional styling.
API Reference
ThoughtChain
Wrapper component that clones children and injects the _isLast prop into the final step.
| Prop | Type | Default |
|---|---|---|
children | React.ReactNode | - |
ThoughtChainStep
| Prop | Type | Default |
|---|---|---|
status? | "done" | "active" | "pending" | "pending" |
defaultOpen? | boolean | true |
children | React.ReactNode | - |
ThoughtChainTrigger
Clickable header that toggles the step's collapsible content. When the step is active and the children is a plain string, it renders with a shimmer animation.
ThoughtChainContent
Animated collapsible body. Uses AnimatePresence with height and opacity transitions.
ThoughtChainItem
Individual bullet item inside ThoughtChainContent. Animates in with a fade + upward slide.