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.

Install using CLI

AI Elements Vue
shadcn-vue CLI
npx ai-elements-vue@latest add plan

Install Manually

Copy and paste the following code in the same folder.

Plan.vue
PlanHeader.vue
PlanTitle.vue
PlanDescription.vue
PlanAction.vue
PlanContent.vue
PlanFooter.vue
PlanTrigger.vue
context.ts
index.ts
<script setup lang="ts">
import type { HTMLAttributes } from 'vue'
import { Card } from '@repo/shadcn-vue/components/ui/card'
import { Collapsible } from '@repo/shadcn-vue/components/ui/collapsible'
import { cn } from '@repo/shadcn-vue/lib/utils'
import { computed } from 'vue'
import { providePlan } from './context'

interface PlanProps {
  isStreaming?: boolean
  class?: HTMLAttributes['class']
}

const props = withDefaults(
  defineProps<PlanProps>(),
  {
    isStreaming: false,
  },
)

providePlan({
  isStreaming: computed(() => props.isStreaming),
})
</script>

<template>
  <Collapsible as-child data-slot="plan" v-bind="props">
    <Card :class="cn('shadow-none', props.class)">
      <slot />
    </Card>
  </Collapsible>
</template>

Features

  • Collapsible content with smooth animations
  • Streaming support with shimmer loading states
  • Built on shadcn-vue 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 />

isStreamingboolean
false
Whether content is currently streaming. Enables shimmer animations on title and description. Defaults to false.
defaultOpenboolean
false
Whether the plan is expanded by default.
classstring
Additional classes applied to the component.

<PlanHeader />

classstring
Additional classes applied to the component.

<PlanDescription />

classstring
Additional classes applied to the component.

<PlanTrigger />

classstring
Additional classes applied to the component.

:::