Plan

A collapsible plan component for displaying AI-generated execution plans with streaming support and shimmer animations.

The Plan component provides a flexible system for displaying AI-generated execution plans with collapsible content. Perfect for showing multi-step workflows, task breakdowns, and implementation strategies with support for streaming content and loading states.

See scripts/plan.tsx for this example.

Installation

npx ai-elements@latest add plan

Features

  • Collapsible content with smooth animations
  • Streaming support with shimmer loading states
  • Built on shadcn/ui Card and Collapsible components
  • TypeScript support with comprehensive type definitions
  • Customizable styling with Tailwind CSS
  • Responsive design with mobile-friendly interactions
  • Keyboard navigation and accessibility support
  • Theme-aware with automatic dark mode support
  • Context-based state management for streaming

Props

<Plan />

PropTypeDefaultDescription
isStreamingbooleanfalseWhether content is currently streaming. Enables shimmer animations on title and description.
defaultOpenboolean-Whether the plan is expanded by default.
...propsReact.ComponentProps<typeof Collapsible>-Any other props are spread to the Collapsible component.

<PlanHeader />

PropTypeDefaultDescription
...propsReact.ComponentProps<typeof CardHeader>-Any other props are spread to the CardHeader component.

<PlanTitle />

PropTypeDefaultDescription
childrenstring-The title text. Displays with shimmer animation when isStreaming is true.
...propsOmit<React.ComponentProps<typeof CardTitle>,-Any other props (except children) are spread to the CardTitle component.

<PlanDescription />

PropTypeDefaultDescription
childrenstring-The description text. Displays with shimmer animation when isStreaming is true.
...propsOmit<React.ComponentProps<typeof CardDescription>,-Any other props (except children) are spread to the CardDescription component.

<PlanTrigger />

PropTypeDefaultDescription
...propsReact.ComponentProps<typeof CollapsibleTrigger>-Any other props are spread to the CollapsibleTrigger component. Renders as a Button with chevron icon.

<PlanContent />

PropTypeDefaultDescription
...propsReact.ComponentProps<typeof CardContent>-Any other props are spread to the CardContent component.

<PlanFooter />

PropTypeDefaultDescription
...propsReact.ComponentProps<-Any other props are spread to the div element.

<PlanAction />

PropTypeDefaultDescription
...propsReact.ComponentProps<typeof CardAction>-Any other props are spread to the CardAction component.