Plan

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

Rewrite AI Elements to SolidJS

Rewrite the AI Elements component library from React to SolidJS while maintaining compatibility with existing React-based shadcn/ui components using solid-js/compat, updating all 29 components and their test suite.

Installation

pnpm dlx shadcn-svelte@latest add https://svelte-ai-elements.vercel.app/r/plan.json

If you prefer using jsrepo, please install via the command below:

pnpm dlx jsrepo add @ai/elements/ai-elements/plan

Props

Plan

The main wrapper component that provides context and collapsible functionality.

Plan

PropTypeDefaultDescription
isStreamingbooleanfalseWhether the plan is in streaming state (shows shimmer effect)
defaultOpenbooleanfalseWhether the plan is expanded by default
openboolean-Controlled open state
onOpenChange(open: boolean) => void-Callback when open state changes
classstring-Additional CSS classes to apply
childrenSnippet-Plan content (PlanHeader, PlanContent, PlanFooter)

PlanTitle

Displays the plan title with automatic shimmer effect during streaming.

PlanTitle

PropTypeDefaultDescription
childrenSnippet-Title content (automatically gets shimmer effect when isStreaming is true)
classstring-Additional CSS classes to apply

PlanDescription

Displays the plan description with automatic shimmer effect during streaming.

PlanDescription

PropTypeDefaultDescription
childrenSnippet-Description content (automatically gets shimmer effect when isStreaming is true)
classstring-Additional CSS classes to apply

PlanContent

The collapsible content area for plan details.

PlanContent

PropTypeDefaultDescription
childrenSnippet-Collapsible content
classstring-Additional CSS classes to apply

Other Components

Additional components for plan structure:

  • PlanHeader - Header section containing title, description, and trigger
  • PlanAction - Wrapper for action elements (trigger, buttons)
  • PlanTrigger - Toggle button with chevron icon to expand/collapse
  • PlanFooter - Footer section for additional actions

Notes

  • The isStreaming prop automatically applies shimmer effects to PlanTitle and PlanDescription components.
  • Built on top of shadcn-svelte's Card, Button, and Collapsible components.
  • Uses the Shimmer component internally for streaming animations.
  • Fully accessible with proper ARIA labels and keyboard navigation support via the underlying Collapsible component.
  • Perfect for displaying AI-generated execution plans, task breakdowns, and multi-step processes.