AI Reasoning
A collapsible disclosure for the model's reasoning.
- AI
- 1 file
- 1 npm package
- Accessibility notes
pnpm dlx @dowel-ui/cli add ai-reasoningnpm packages installed: radix-ui.
import { Reasoning } from "@/components/ui/ai-reasoning";Default
Streaming
Expanded
Auto Open Collapse
With Duration
Shimmer
<Reasoning>
| Prop | Type | Default |
|---|---|---|
autoCollapseClose after streaming ends, unless the reader has toggled it; a number is the delay in milliseconds. Never closes while focus or the pointer is inside the trace. Ignored when | boolean | number | false |
autoOpenOpen when | boolean | false |
onOpenChangeCalled when the reader opens or closes the trace. | (open: boolean) => void | — |
streamingReasoning is still arriving. Feeds the trigger's default label and the auto behaviours below. | boolean | — |
Every prop of Radix UI’s Collapsible.Root, plus className.
<ReasoningTrigger>
| Prop | Type | Default |
|---|---|---|
durationSeconds spent reasoning. When set and not streaming, the label becomes | number | — |
durationLabelWords for a duration. | (seconds: number) => string | defaultDurationLabel |
label | string | "Reasoning" |
shimmerShimmer the label while streaming. Decoration: it stops under reduced motion. | boolean | false |
streamingShown while reasoning is still arriving. Defaults to the root's | boolean | — |
streamingLabel | string | "Thinking…" |
Every prop of Radix UI’s Collapsible.Trigger, plus className.
<ReasoningContent>
Every prop of Radix UI’s Collapsible.Content, plus className.
8/8
checks passed
- Tested — passes
- axe assertion — passes
- Keyboard tested — does not apply
- Storybook examples — passes
- Accessibility documented — passes
- Semantic tokens only — passes
- Motion from tokens — passes
- className merged — passes
- Visible focus — does not apply
- No fixed widths — passes