Reasoning

A collapsible component for showing AI reasoning, explanations, or logic. You can control it manually or let it auto-close when the stream ends. Markdown is supported.

mode-watcherrunedstreamdown-svelte@streamdown-svelte/code

Installation

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

Examples

Demo

Props

Reasoning

PropTypeDefaultDescription
childrenSnippet-Reasoning trigger and content blocks.
classstring-Additional CSS classes for the wrapper.
openboolean-Controlled open state for the collapsible reasoning panel.
onOpenChange(open: boolean) => void-Called when the open state changes.
isStreamingbooleanfalseAutomatically opens while streaming and closes when streaming stops.

ReasoningTrigger

PropTypeDefaultDescription
childrenSnippet-Trigger label content.
classstring-Additional CSS classes for the button.

ReasoningContent

PropTypeDefaultDescription
childrenSnippet-Fallback content rendered when no markdown string is provided.
contentstring-Markdown string rendered by Streamdown when present.
classstring-Additional CSS classes for the outer content wrapper.
contentClassstring-Additional CSS classes for the inner markdown container.
markdownbooleanfalseReserved for markdown-mode integrations.