Reasoning
New"Thinking…" panel for reasoning models: opens while the model thinks, shows how long it took, folds away after.
Installation
$ pnpm dlx shadcn@latest add @synccn/reasoningFirst time in this project? Connect synccn with one command.
Usage
import { Reasoning } from "@/components/ui/reasoning";<Reasoning streaming={thinking}>{thoughts}</Reasoning>API reference
Generated from the component's TypeScript types, so it always matches the code.
Reasoning
Collapsible "Thinking…" panel for reasoning models. It opens while the model thinks, shows how long it took, and folds away once the answer starts.
- children
React.ReactNodeThe model's reasoning text, which can grow while it streams.
- streaming
booleanDefault
falseTrue while the model is still thinking. Opens the panel, and closes it again when thinking ends.
- duration
numberHow long it thought, in seconds. Measured automatically when not given.
- defaultOpen
booleanDefault
falseOpen at first, when not streaming.
- className
stringExtra classes for the root element.
Dependencies
Read from the component's imports when the site builds. The CLI installs all of these for you.
Helpers
- lib/utilscn (merges class names)
npm packages
- clsx for cn()
- tailwind-merge for cn()
- lucide-react for Brain, ChevronDown
Used by
Keyboard
- EnterorSpaceShow or hide the reasoning
Accessibility
- The toggle uses aria-expanded and aria-controls; once the person opens or closes it, it stops opening and closing by itself.
From the source
Read from this component's code when the site builds, so it can't drift.
- ARIA attributes: aria-controls, aria-expanded, aria-hidden
- Respects the reduced motion setting