Thinking Bar
prompt-kit/thinking-barFreeComponent
A component to display the thinking state of an AI model with optional actions.
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/thinking-bar.jsonSource
1"use client"23import { TextShimmer } from "@/components/prompt-kit/text-shimmer"4import { cn } from "@/lib/utils"5import { ChevronRight } from "lucide-react"67type ThinkingBarProps = {8 className?: string9 text?: string10 onStop?: () => void11 stopLabel?: string12 onClick?: () => void13}1415export function ThinkingBar({16 className,17 text = "Thinking",18 onStop,19 stopLabel = "Answer now",20 onClick,21}: ThinkingBarProps) {22 return (23 <div className={cn("flex w-full items-center justify-between", className)}>24 {onClick ? (25 <button26 type="button"27 onClick={onClick}28 className="flex items-center gap-1 text-sm transition-opacity hover:opacity-80"29 >30 <TextShimmer className="font-medium">{text}</TextShimmer>31 <ChevronRight className="text-muted-foreground size-4" />32 </button>33 ) : (34 <TextShimmer className="cursor-default font-medium">{text}</TextShimmer>35 )}36 {onStop ? (37 <button38 onClick={onStop}39 type="button"40 className="text-muted-foreground hover:text-foreground border-muted-foreground/50 hover:border-foreground border-b border-dotted text-sm transition-colors"41 >42 {stopLabel}43 </button>44 ) : null}45 </div>46 )47}
What it pulls in
npm packages
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 |
