An inline status that shows what an AI is doing, from thinking and researching to writing and done.
Press Replay to watch a reply go from thinking to done. Each state brings its own animated icon and a shimmering label, and the answer appears once it finishes.
Options you can pass to customize this component.
state"thinking""researching""analyzing""writing""done""error"stringA built-in state or any key from states.
statesRecord<string, { label?: string | ((elapsed?: string) => string); icon?: ReactNode; active?: boolean }>Adds custom states or overrides built-in ones, each with a label, icon, and active flag.
labelstringReplaces the text for the current state.
iconReactNodeReplaces the icon for the current state.
detailstringMuted text after the label, like "12 sources".
faviconstringReactNodeA small logo before the detail, as an image url or element.
timerbooleanShows how many seconds the run has taken.
elapsednumberSeconds to show instead of the built-in count.
shimmerbooleanForces the label shimmer on or off.
classNamestringExtra classes merged onto the root element (data-slot="ai-status").
npx shadcn@latest add swamimalode07/rare-ui/ai-status"use client"import { AiStatus, AiStatusIcon } from "@/components/ui/ai-status"export function Status({ step }: { step: string }) {return (<AiStatusstate={step}detail="12 sources"states={{// a custom state that reuses a built-in iconbrowsing: { label: "Browsing", icon: <AiStatusIcon state="researching" /> },// a custom state with your own svgcoding: {label: "Writing code",icon: (<svg viewBox="0 0 24 24" width={18} height={18} fill="none" stroke="currentColor" strokeWidth={2}><path d="M8 6l-6 6 6 6M16 6l6 6-6 6" /></svg>),},// override a built-in labeldone: { label: (time) => (time ? `Answered in ${time}` : "Answered"), active: false },}}/>)}
Click the code icon in the top-right corner to view the source code.
Most components here are recreations of great work from around the web. I don't claim to be the original creator - this is my attempt to reverse-engineer, replicate, and often add a few extra features. I've tried to credit everyone; if I missed someone, let me know.
1
How do I add a Rare UI component to my project?