Get Started
Components
- Alert
- Avatar
- Badge
- Breadcrumb
- Button
- Button Group
- Calendar
- Card
- Carousel
- Chart
- Checkbox
- Checkbox Group
- ComboBox
- Command
- Data Table
- Date Field
- Date Picker
- Date Range Picker
- Dialog
- Disclosure
- Disclosure Group
- Drawer
- Empty
- Field
- File Trigger
- Form
- Grid List
- Hover Card
- Input
- Input Group
- Input OTP
- Item
- Kbd
- Label
- ListBox
- Menu
- Number Field
- Pagination
- Popover
- Progress Bar
- Radio Group
- Range Calendar
- Resizable
- Search Field
- Select
- Separator
- Sheet
- Sidebar
- Skeleton
- Slider
- Sonner
- Spinner
- Switch
- Table
- Tabs
- Tag Group
- Text Field
- Textarea
- Time Field
- Toast
- Toggle Button
- Toggle Button Group
- Tooltip
- Tree
- Typography
AI Elements
Build a Todo App
Create a full-featured todo application with React and TypeScript
1.Set up project structure with Vite and TypeScript
2.Create todo item component with edit and delete actions
3.Implement state management using React hooks
4.Add local storage persistence
5.Style with Tailwind CSS and add animations
import {
Plan,
PlanAction,
PlanContent,
PlanDescription,
PlanFooter,
PlanHeader,
PlanTitle,
PlanTrigger,
} from "@/components/ai-elements/plan"
import { Button } from "../ui/button"
export function PlanDemo() {
return (
<div className="w-full max-w-2xl">
<Plan defaultExpanded={false} isStreaming={false}>
<PlanHeader>
<div className="space-y-1">
<PlanTitle>Build a Todo App</PlanTitle>
<PlanDescription>
Create a full-featured todo application with React and TypeScript
</PlanDescription>
</div>
<PlanAction>
<PlanTrigger />
</PlanAction>
</PlanHeader>
<PlanContent>
<div className="space-y-2 text-sm">
<div className="flex items-start gap-2">
<span className="text-muted-foreground">1.</span>
<span>Set up project structure with Vite and TypeScript</span>
</div>
<div className="flex items-start gap-2">
<span className="text-muted-foreground">2.</span>
<span>
Create todo item component with edit and delete actions
</span>
</div>
<div className="flex items-start gap-2">
<span className="text-muted-foreground">3.</span>
<span>Implement state management using React hooks</span>
</div>
<div className="flex items-start gap-2">
<span className="text-muted-foreground">4.</span>
<span>Add local storage persistence</span>
</div>
<div className="flex items-start gap-2">
<span className="text-muted-foreground">5.</span>
<span>Style with Tailwind CSS and add animations</span>
</div>
</div>
</PlanContent>
</Plan>
</div>
)
}
Installation
CLI
Manual
pnpmnpmyarnbunpnpm dlx shadcn@latest add plan
Usage
import {
Plan,
PlanHeader,
PlanTitle,
PlanDescription,
PlanAction,
PlanTrigger,
PlanContent,
} from "@/components/ai-elements/plan"<Plan isStreaming={false}>
<PlanHeader>
<div>
<PlanTitle>Build a Todo App</PlanTitle>
<PlanDescription>Create a full-featured todo application</PlanDescription>
</div>
<PlanAction>
<PlanTrigger />
</PlanAction>
</PlanHeader>
<PlanContent>
{/* Plan steps */}
</PlanContent>
</Plan>Examples
Default
Build a Todo App
Create a full-featured todo application with React and TypeScript
1.Set up project structure with Vite and TypeScript
2.Create todo item component with edit and delete actions
3.Implement state management using React hooks
4.Add local storage persistence
5.Style with Tailwind CSS and add animations
import {
Plan,
PlanAction,
PlanContent,
PlanDescription,
PlanFooter,
PlanHeader,
PlanTitle,
PlanTrigger,
} from "@/components/ai-elements/plan"
import { Button } from "../ui/button"
export function PlanDemo() {
return (
<div className="w-full max-w-2xl">
<Plan defaultExpanded={false} isStreaming={false}>
<PlanHeader>
<div className="space-y-1">
<PlanTitle>Build a Todo App</PlanTitle>
<PlanDescription>
Create a full-featured todo application with React and TypeScript
</PlanDescription>
</div>
<PlanAction>
<PlanTrigger />
</PlanAction>
</PlanHeader>
<PlanContent>
<div className="space-y-2 text-sm">
<div className="flex items-start gap-2">
<span className="text-muted-foreground">1.</span>
<span>Set up project structure with Vite and TypeScript</span>
</div>
<div className="flex items-start gap-2">
<span className="text-muted-foreground">2.</span>
<span>
Create todo item component with edit and delete actions
</span>
</div>
<div className="flex items-start gap-2">
<span className="text-muted-foreground">3.</span>
<span>Implement state management using React hooks</span>
</div>
<div className="flex items-start gap-2">
<span className="text-muted-foreground">4.</span>
<span>Add local storage persistence</span>
</div>
<div className="flex items-start gap-2">
<span className="text-muted-foreground">5.</span>
<span>Style with Tailwind CSS and add animations</span>
</div>
</div>
</PlanContent>
</Plan>
</div>
)
}
export default function Example() {
return (
<Plan defaultOpen={false} isStreaming={false}>
<PlanHeader>
<div className="space-y-1">
<PlanTitle>Build a Todo App</PlanTitle>
<PlanDescription>
Create a full-featured todo application with React and TypeScript
</PlanDescription>
</div>
<PlanAction>
<PlanTrigger />
</PlanAction>
</PlanHeader>
<PlanContent>
<div className="space-y-2 text-sm">
<div className="flex items-start gap-2">
<span className="text-muted-foreground">1.</span>
<span>Set up project structure</span>
</div>
<div className="flex items-start gap-2">
<span className="text-muted-foreground">2.</span>
<span>Create todo item component</span>
</div>
<div className="flex items-start gap-2">
<span className="text-muted-foreground">3.</span>
<span>Implement state management</span>
</div>
</div>
</PlanContent>
</Plan>
)
}Features
- Streaming Support: Shows shimmer effect while content is streaming
- Collapsible: Expandable/collapsible content
- Card Layout: Built on top of the Card component
API Reference
Plan
Main plan container.
| Prop | Type | Default | Description |
|---|---|---|---|
isStreaming | boolean | false | Whether plan is currently streaming |
defaultOpen | boolean | false | Initial open state |
className | string | - | Custom CSS classes |
PlanHeader
Header section.
| Prop | Type | Default | Description |
|---|---|---|---|
className | string | - | Custom CSS classes |
PlanTitle
Plan title with shimmer support.
| Prop | Type | Default | Description |
|---|---|---|---|
children | string | - | Title text |
PlanDescription
Plan description with shimmer support.
| Prop | Type | Default | Description |
|---|---|---|---|
children | string | - | Description text |
className | string | - | Custom CSS classes |
PlanContent
Collapsible content area.
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | - | Plan content |
PlanTrigger
Button to toggle plan visibility.
| Prop | Type | Default | Description |
|---|---|---|---|
className | string | - | Custom CSS classes |