Plan
tool-ui/planFreeBlock
Display step-by-step task workflows in AI interfaces.
See it running
Open the demo on tool-ui
www.tool-ui.com/components/planInstall it
npx shadcn@latest add https://www.tool-ui.com/r/plan.jsonSource
1"use client";23import * as React from "react";4import { useMemo, useState, useEffect, useRef, memo } from "react";5import { Loader2, Check, X, MoreHorizontal, ChevronRight } from "lucide-react";6import type { PlanProps, PlanTodo, PlanTodoStatus } from "./schema";7import {8 cn,9 Card,10 CardHeader,11 CardTitle,12 CardDescription,13 CardContent,14 Accordion,15 AccordionItem,16 AccordionTrigger,17 AccordionContent,18 Collapsible,19 CollapsibleTrigger,20 CollapsibleContent,21} from "./_adapter";22import { calculatePlanProgress, shouldCelebrateProgress } from "./progress";2324const INITIAL_VISIBLE_TODO_COUNT = 4;2526const TodoIcon = memo(function TodoIcon({27 status,28}: {29 status: PlanTodoStatus;30}) {31 if (status === "pending") {32 return (33 <span34 className="border-border bg-card flex size-6 shrink-0 items-center justify-center rounded-full border motion-safe:transition-all motion-safe:duration-200"35 aria-hidden="true"36 />37 );38 }3940 if (status === "in_progress") {41 return (42 <span43 className="border-border bg-card flex size-6 shrink-0 items-center justify-center rounded-full border shadow-[0_0_0_4px_hsl(var(--primary)/0.1)] motion-safe:transition-all motion-safe:duration-300"44 aria-hidden="true"45 >46 <Loader2 className="text-primary size-5 motion-safe:animate-spin" />47 </span>48 );49 }5051 if (status === "completed") {52 return (53 <span54 className="border-primary bg-primary flex size-6 shrink-0 items-center justify-center rounded-full border shadow-sm motion-safe:animate-in motion-safe:fade-in motion-safe:zoom-in-75 motion-safe:duration-300 motion-safe:ease-out"55 aria-hidden="true"56 >57 <Check58 className="text-primary-foreground size-4 motion-safe:animate-in motion-safe:fade-in motion-safe:zoom-in-75 motion-safe:delay-75 motion-safe:duration-200 motion-safe:fill-mode-both"59 strokeWidth={3}60 />61 </span>62 );63 }6465 if (status === "cancelled") {66 return (67 <span68 className="border-destructive bg-destructive flex size-6 shrink-0 items-center justify-center rounded-full border shadow-sm motion-safe:animate-in motion-safe:fade-in motion-safe:zoom-in-75 motion-safe:duration-300 motion-safe:ease-out dark:border-red-600 dark:bg-red-600"69 aria-hidden="true"70 >71 <X72// … truncated
What it pulls in
npm packages
Other registry items
Files it writes
More from tool-ui
All 27 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Approval Cardapproval-card | tool-ui | Blocks | Free | 2 deps · 11 files | |
| Audioaudio | tool-ui | Blocks | Free | 2 deps · 9 files | |
| Chartchart | tool-ui | Blocks | Free | 2 deps · 8 files | |
| Citationcitation | tool-ui | Blocks | Free | 2 deps · 15 files | |
| Code Blockcode-block | tool-ui | Blocks | Free | 3 deps · 11 files | |
| Code Diffcode-diff | tool-ui | Blocks | Free | 3 deps · 10 files | |
| Data Tabledata-table | tool-ui | Blocks | Free | 1 dep · 17 files | |
| Geo Mapgeo-map | tool-ui | Blocks | Free | 4 deps · 12 files |
