Skip to content
h v3.13.3
Search the docs
Find a component, section or page.

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-ui

Usage

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

isStreaming boolean
Default false
duration number
Default 0
children Snippet
open bindable boolean
Default false
class string
...rest
Every prop of Collapsible.Root from bits-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

children Snippet
class string
...rest
Every prop of Collapsible.Trigger from bits-ui
Prop Type Default
children Snippet
class string
...rest Every prop of Collapsible.Trigger from bits-ui

Reasoning.Content

children Snippet
class string
...rest
Every prop of Collapsible.Content from bits-ui
Prop Type Default
children Snippet
class string
...rest Every prop of Collapsible.Content from bits-ui