Docs / Components / Agent Thinking

Agent Thinking

An AI agent thinking component that displays the agent's thought process with a typing effect and smooth expand/collapse animation.

Dependencies

Install the following dependencies to use this component:

1npm install framer-motion clsx tailwind-merge lucide-react

Installation

Run the following command in your terminal to add the component to your project:

1npx rankflow-ui@latest add agent-thinking

Props Reference

PropTypeDefaultDescription
thoughtstring'-'The thinking text content to stream or display.
isStreamingbooleanfalseWhether the thinking process is actively streaming.
streamSpeednumber24Speed of simulated streaming in milliseconds per character.
streamingLabelstring'Thinking'Custom label displayed while the agent is thinking.
completedLabelstring | ((durationSec: number) => string)'Thought for {duration}s'Custom label displayed after thinking completes.
showDurationbooleantrueWhether to show the elapsed duration counter.
defaultOpenbooleantrueInitial open state of the thinking dropdown.
openbooleanundefinedControlled open state.
onOpenChange(open: boolean) => voidundefinedCallback fired when open state changes.
autoCollapseOnCompletebooleanfalseWhether to automatically collapse the dropdown when streaming concludes.
onStreamComplete() => voidundefinedCallback fired when streaming finishes.
iconReactNodeundefinedCustom icon or indicator.
maxHeightnumber240Maximum height of the thoughts scroll area in pixels.
classNamestring''Additional container CSS classes.