For AI agents: the complete documentation index is available at https://wallarm.github.io/design-system/llms.txt, the full documentation bundle is available at https://wallarm.github.io/design-system/llms-full.txt, and this page is available as Markdown at https://wallarm.github.io/design-system/components/chain-of-thought.md.

ChainOfThought

A read-only log of what Wally did while answering — searches, tool calls, its own reasoning — so the user can see how it got there without the steps crowding the answer. Each ChainOfThoughtStep is one line: a type icon, a label and an optional right-aligned metric, joined to the next step by a thin connector. A step with children becomes a collapsible trigger, and children can be another ChainOfThought, so runs nest as deep as the agent did. The app owns the mapping from step type to icon (see Type Icons); the DS only draws the row.

Source · Storybook

Usage

import { ChainOfThought, ChainOfThoughtStep } from '@wallarm-org/design-system/ChainOfThought';
import { Brain, Database, FileText, Search } from '@wallarm-org/design-system/icons';

Examples

Nested

Steps with children toggle open; a nested chain can hold its own collapsible steps.

Simple rows

icon={null} gives the Figma "Simple" row: no icon cell, no connector, 16px apart.

Simple result

metric adds a right-aligned mono value — the Figma "Simple-result" row.

Working

status='running' shimmers the label while the step is in progress.

Streaming

A step that mounts as running fades in and settles 4px; the previous step's connector grows toward it; on done the shimmer fades into the plain label. Steps that mount done (history) appear instantly. All of it is off under prefers-reduced-motion.

Error step

status='error' tints the label and the type icon danger, for a step that failed. Word the label as a failure too (color alone is not enough); put the detail in the step's children. Not in Figma yet; pending design review.

Worked summary

The whole run folded under one "Worked for …" step with the Activity icon.

Rich text content

Nested content can be prose: paragraphs, bullets and inline code.

Type icons

The recommended step-type → icon mapping. The app owns it; this is documentation only.

Controlled

open + onOpenChange drive the step from outside.

Analytics

data-analytics-* on a collapsible step lands on the row <button>, not the <li>.

Props

PropTypeDefaultDescription
type"a" | "i" | "1" | "A" | "I" | undefined
defaultCheckedboolean | undefined
defaultValuestring | number | readonly string[] | undefined
autoFocusboolean | undefined
idstring | undefined
tabIndexnumber | undefined
titlestring | undefined
relstring | undefined
onChangeChangeEventHandler<T, Element> | undefined
data-testidstring | undefined

ChainOfThoughtStep

PropTypeDefaultDescription
label *ReactNodeRow text: 'Searched for ABC', 'Working...', 'Thought for 5s', 'Worked for 3m 45s'.
iconReactNodeDEFAULT_ICON16px type icon. Default <CircleDashed />. null = Figma "Simple" row (no icon cell, no connector).
metricReactNodeRight-aligned mono slot = Figma "Simple-result".
status"done" | "running" | "error" | undefineddone'running' shimmers the label (Figma "Working"). 'error' tints the label and icon danger (not in Figma yet; pending design review) and prefixes a visually hidden "Error:" for screen readers; still word the label so it reads as a failure ('get_attacks failed'). Default 'done'. Reflected in the li's data-status. A step that mounts as 'running' gets data-entered and animates in (and fades its shimmer out on 'done'); one mounted 'done' renders static.
openboolean | undefinedControlled open state of the nested content.
defaultOpenboolean | undefinedfalseInitial open state when uncontrolled. Default false.
onOpenChange((open: boolean) => void) | undefined
titlestring | undefined
defaultCheckedboolean | undefined
defaultValuestring | number | readonly string[] | undefined
autoFocusboolean | undefined
idstring | undefined
tabIndexnumber | undefined
relstring | undefined
onChangeChangeEventHandler<T, Element> | undefined
data-testidstring | undefined

Explorer