Reasoning
A collapsible thought trail with how long it took.
AnimatedBeam already lives in @heyramzi/ui, so the fix is to re-export it and migrate the two
consumers rather than copy the keyframes a third time.
Installation
pnpm add @heyramzi/ui bits-uiUsage
import { Reasoning, ReasoningTrigger, ReasoningContent } from "@heyramzi/ui/ai/reasoning";<Reasoning duration={4}>
<ReasoningTrigger />
<ReasoningContent>The model's reasoning, as text.</ReasoningContent>
</Reasoning>Keyboard and accessibility
| Key | Does |
|---|---|
| Space Enter | Opens or closes the reasoning. |
- The trigger is a button that reports open or closed.
- It opens by itself when streaming starts and closes when it ends. Focus doesn't move.
- The label changes from "Thinking..." to "Thought for 4s", but that change isn't read out.
- With reduced motion on, the open animation and the pulsing icon stop.
API reference
Reasoning.Reasoning
isStreamingboolean- Default
false durationnumber- Default
0 childrenSnippetopenbindableboolean- Default
false classstring...rest- Every prop of
Collapsible.Rootfrombits-ui
| Prop | Type | Default |
|---|---|---|
isStreaming | boolean | false |
duration | number | 0 |
children | Snippet | |
open bindable | boolean | false |
class | string | |
...rest | Every prop of Collapsible.Root from bits-ui | |
Reasoning.Trigger
childrenSnippetclassstring...rest- Every prop of
Collapsible.Triggerfrombits-ui
| Prop | Type | Default |
|---|---|---|
children | Snippet | |
class | string | |
...rest | Every prop of Collapsible.Trigger from bits-ui | |
Reasoning.Content
childrenSnippetclassstring...rest- Every prop of
Collapsible.Contentfrombits-ui
| Prop | Type | Default |
|---|---|---|
children | Snippet | |
class | string | |
...rest | Every prop of Collapsible.Content from bits-ui | |