Steps
prompt-kit/stepsFreeComponent
A component for displaying a sequence of operations in a collapsible layout. Each step can include details and an optional vertical bar. Useful for showing AI steps like reasoning traces, tool calls, or process logs.
Live preview
live · rendered by the registry
Rendered by prompt-kit on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://raw.githubusercontent.com/ibelick/prompt-kit/HEAD/public/c/steps.jsonSource
1"use client"23import {4 Collapsible,5 CollapsibleContent,6 CollapsibleTrigger,7} from "@/components/ui/collapsible"8import { cn } from "@/lib/utils"9import { ChevronDown } from "lucide-react"1011export type StepsItemProps = React.ComponentProps<"div">1213export const StepsItem = ({14 children,15 className,16 ...props17}: StepsItemProps) => (18 <div className={cn("text-muted-foreground text-sm", className)} {...props}>19 {children}20 </div>21)2223export type StepsTriggerProps = React.ComponentProps<24 typeof CollapsibleTrigger25> & {26 leftIcon?: React.ReactNode27 swapIconOnHover?: boolean28}2930export const StepsTrigger = ({31 children,32 className,33 leftIcon,34 swapIconOnHover = true,35 ...props36}: StepsTriggerProps) => (37 <CollapsibleTrigger38 className={cn(39 "group text-muted-foreground hover:text-foreground flex w-full cursor-pointer items-center justify-start gap-1 text-sm transition-colors",40 className41 )}42 {...props}43 >44 <div className="flex items-center gap-2">45 {leftIcon ? (46 <span className="relative inline-flex size-4 items-center justify-center">47 <span48 className={cn(49 "transition-opacity",50 swapIconOnHover && "group-hover:opacity-0"51 )}52 >53 {leftIcon}54 </span>55 {swapIconOnHover && (56 <ChevronDown className="absolute size-4 opacity-0 transition-opacity group-hover:opacity-100 group-data-[state=open]:rotate-180" />57 )}58 </span>59 ) : null}60 <span>{children}</span>61 </div>62 {!leftIcon && (63 <ChevronDown className="size-4 transition-transform group-data-[state=open]:rotate-180" />64 )}65 </CollapsibleTrigger>66)6768export type StepsContentProps = React.ComponentProps<69 typeof CollapsibleContent70> & {71 bar?: React.ReactNode72}7374export const StepsContent = ({75 children,76 className,77 bar,78 ...props79}: StepsContentProps) => {80 return (81 <CollapsibleContent82 className={cn(83 "text-popover-foreground data-[state=closed]:animate-collapsible-up data-[state=open]:animate-collapsible-down overflow-hidden",84 className85 )}86 {...props}87 >88 <div className="mt-3 grid max-w-full min-w-0 grid-cols-[min-content_minmax(0,1fr)] items-start gap-x-3">89 <div className="min-w-0 self-stretch">{bar ?? <StepsBar />}</div>90 <div className="min-w-0 space-y-2">{children}</div>91 </div>92 </CollapsibleContent>93 )94}9596// … truncated
What it pulls in
Other registry items
Files it writes
More from prompt-kit
All 23 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Chain Of Thoughtchain-of-thought | prompt-kit | Components | Free | 1 dep | |
| Chat Containerchat-container | prompt-kit | Components | Free | 1 dep | |
| Code Blockcode-block | prompt-kit | Components | Free | 1 dep | |
| Feedback Barfeedback-bar | prompt-kit | Components | Free | 1 dep | |
| File Uploadfile-upload | prompt-kit | Components | Free | no deps | |
| Imageimage | prompt-kit | Components | Free | no deps | |
| Jsx Previewjsx-preview | prompt-kit | Components | Free | 1 dep | |
| Loaderloader | prompt-kit | Components | Free | no deps |
