Components
- Accordion
- Alert
- Alert Dialog
- Aspect Ratio
- Attachment
- Autocomplete
- Avatar
- Badge
- Breadcrumb
- Bubble
- Button
- Calendar
- Card
- Carousel
- Chart
- Checkbox
- Checkbox Group
- Collapsible
- Combobox
- Command
- Context Menu
- Date Picker
- Dialog
- Drawer
- Dropdown Menu
- Empty
- Field
- Fieldset
- Form
- Frame
- Group
- Input
- Input Group
- Kbd
- Label
- Menu
- Menubar
- Message
- Meter
- Number Field
- OTP Field
- Pagination
- Popover
- Preview Card
- Progress
- Questionnaire
- Radio Group
- Scroll Area
- Select
- Separator
- Sheet
- Sidebar
- Skeleton
- Slider
- Spinner
- Switch
- Table
- Tabs
- Textarea
- Toggle
- Toggle Group
- Toolbar
- Tooltip
Shared
- Artifact
- Audio Player
- Canvas
- Chain of Thought
- Checkpoint
- Code Block
- Commit
- Connection
- Context
- Controls
- Edge
- Environment Variables
- Mic Selector
- Model Selector
- Node
- Node Toolbar
- Open in Chat
- Panel
- Plan
- Prompt Input
- Queue
- Reasoning
- Sandbox
- Schema Display
- Shimmer
- Snippet
- Sources
- Speech Input
- Stack Trace
- Suggestion
- Tool
- Transcription
- Web Preview
Hooks
Resources
Reasoning
A collapsible, streamable reasoning trace.
The user wants a button variant. I should:
- Check how existing variants are declared.
- Add the variant to the CVA config.
- Keep the class order consistent with the neighbours.
import { Reasoning, ReasoningContent, ReasoningTrigger } from "@/registry/default/shared/reasoning";
const thought = `The user wants a button variant. I should:
1. Check how existing variants are declared.
2. Add the variant to the CVA config.
3. Keep the class order consistent with the neighbours.`;
export default function Particle() {
return (
<div className="w-full max-w-lg">
<Reasoning defaultOpen duration={4}>
<ReasoningTrigger />
<ReasoningContent>{thought}</ReasoningContent>
</Reasoning>
</div>
);
}
Installation
pnpm dlx shadcn@latest add @frontal-labs/reasoning
Usage
import { Reasoning, ReasoningTrigger, ReasoningContent } from "@/components/reasoning";API Reference
| Export | Props |
|---|---|
Reasoning | Collapsible props, plus its own options |
ReasoningTrigger | CollapsibleTrigger props, plus its own options |
ReasoningContent | CollapsibleContent props, plus its own options |
Open the source under Manual above for the exact prop types.
Examples
The user wants a button variant. I should:
- Check how existing variants are declared.
- Add the variant to the CVA config.
- Keep the class order consistent with the neighbours.
import { Reasoning, ReasoningContent, ReasoningTrigger } from "@/registry/default/shared/reasoning";
const thought = `The user wants a button variant. I should:
1. Check how existing variants are declared.
2. Add the variant to the CVA config.
3. Keep the class order consistent with the neighbours.`;
export default function Particle() {
return (
<div className="w-full max-w-lg">
<Reasoning isStreaming>
<ReasoningTrigger />
<ReasoningContent>{thought}</ReasoningContent>
</Reasoning>
</div>
);
}
On This Page