Chain Of Thought

Display step-by-step reasoning and collapsible thought processes in AI interfaces.

Installation

pnpm dlx shadcn-svelte@latest add http://sveltekit-prerender/r/chain-of-thought.json

Examples

Demo

Build a multi-step reasoning trace with collapsible sections and inline detail items.

Props

ChainOfThought

PropTypeDefaultDescription
childrenSnippet-One or more `ChainOfThoughtStep` blocks.
classstring-Additional CSS classes for the wrapper.

ChainOfThoughtStep

PropTypeDefaultDescription
childrenSnippet-Typically a trigger followed by matching content.
classstring-Additional CSS classes for the step wrapper.

ChainOfThoughtTrigger

PropTypeDefaultDescription
childrenSnippet-Trigger label content.
leftIconSnippet-Optional icon shown before the label.
swapIconOnHoverbooleantrueWhen a left icon is present, swap it with the chevron on hover.
classstring-Additional CSS classes for the trigger.

ChainOfThoughtContent

PropTypeDefaultDescription
childrenSnippet-Expanded detail rows for the current step.
classstring-Additional CSS classes for the collapsible content.

ChainOfThoughtItem

PropTypeDefaultDescription
childrenSnippet-Text or custom markup for a reasoning item.
classstring-Additional CSS classes for the item.