Command Palette

Search for a command to run...

Ai Plan

TODO: Add description

Open in v0Open in
1
Install the Clerk SDK and configure environment variables
2
Wrap the application with ClerkProvider in the root layout
3
Add middleware for route protection
4
Create sign-in and sign-up pages
5
Add user button component to the header
1
Add proper type annotation to the function parameter
2
Run type check to verify the fix

Overview

A compound component for displaying AI-generated execution plans. Supports streaming with a shimmer loading effect, numbered steps, and action buttons for approval workflow. Auto-opens during streaming.

Installation

bunx shadcn@latest add @elements/plan

Usage

import {
  Plan,
  PlanHeader,
  PlanTitle,
  PlanDescription,
  PlanContent,
  PlanFooter,
  PlanAction,
  PlanStep,
} from "@/components/elements/ai-elements/agentic/plan";

export function PlanExample() {
  return (
    <Plan isStreaming={false}>
      <PlanHeader>
        <div>
          <PlanTitle>Implementation Plan</PlanTitle>
          <PlanDescription>3 steps to complete</PlanDescription>
        </div>
      </PlanHeader>
      <PlanContent>
        <div className="space-y-3">
          <PlanStep number={1}>Create database schema</PlanStep>
          <PlanStep number={2}>Implement API endpoints</PlanStep>
          <PlanStep number={3}>Add frontend components</PlanStep>
        </div>
      </PlanContent>
      <PlanFooter>
        <PlanAction variant="secondary">Cancel</PlanAction>
        <PlanAction variant="primary">Execute Plan</PlanAction>
      </PlanFooter>
    </Plan>
  );
}

Props

Plan

PropTypeDefaultDescription
isStreamingbooleanfalseWhether plan is being generated
defaultOpenbooleantrueInitial open state
openboolean-Controlled open state
onOpenChange(open: boolean) => void-Callback when open state changes

PlanAction

PropTypeDefaultDescription
variant"primary" | "secondary" | "destructive""secondary"Button style
disabledbooleanfalseDisable button
onClick() => void-Click handler

PlanStep

PropTypeDescription
numbernumberStep number

Features

  • Shimmer loading during streaming
  • Indigo-themed streaming state
  • Numbered step display
  • Action buttons in footer
  • Auto-disabled buttons during streaming
  • Collapsible with smooth animations