GrokThinking

A component that displays an animated thinking process with expandable details.

Examples

Basic Usage

Thinking for 0 seconds

Tap to read my mind

Analyzing system architecture... Evaluating performance metrics... Reviewing code patterns... Identifying edge cases... Validating business logic... Exploring design alternatives... Assessing security implications... Checking compatibility issues... Examining resource usage... Investigating error handling... Finalizing implementation plan...

Installation

Install the component using the shadcn CLI:

npx shadcn@latest add "https://getaipack.com/c/grok-thinking.json"

After installation, import and start using the component in your project:

import { GrokThinking } from "@/components/ui/grok-thinking";

Component API

GrokThinking

PropTypeDefaultDescription
thinkingStepsSecondsnumber10Duration of the thinking animation in seconds
sourcesnumber20Number of thinking steps to display
thinkingStepsstring[]Array of custom thinking steps to display
classNamestringAdditional CSS classes
childrenReact.ReactNodeOptional child elements to render

GrokThinkingHeader

PropTypeDefaultDescription
secondsnumberCurrent seconds elapsed
thinkingStepsSecondsnumberTotal duration of thinking animation
expandedbooleanWhether the details section is expanded

GrokThinkingSpinner

PropTypeDefaultDescription
secondsnumberCurrent seconds elapsed
thinkingStepsSecondsnumberTotal duration of thinking animation

GrokThinkingthinkingSteps

PropTypeDefaultDescription
thinkingStepsstring[]Array of thinking steps to display
animationStartedbooleanWhether the animation has started
animationCompletebooleanWhether the animation has completed
setAnimationComplete(value: boolean) => voidCallback to update animation complete state