Inline AI Status

An inline status that shows what an AI is doing, from thinking and researching to writing and done.

Dependencies

motionreact-use-measure

Interaction Type

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.

Props

Options you can pass to customize this component.

Prop
Type
Description
state
"thinking""researching""analyzing""writing""done""error"string

A built-in state or any key from states.

states
Record<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.

label
string

Replaces the text for the current state.

icon
ReactNode

Replaces the icon for the current state.

detail
string

Muted text after the label, like "12 sources".

favicon
stringReactNode

A small logo before the detail, as an image url or element.

timer
boolean

Shows how many seconds the run has taken.

elapsed
number

Seconds to show instead of the built-in count.

shimmer
boolean

Forces the label shimmer on or off.

className
string

Extra classes merged onto the root element (data-slot="ai-status").

Installation

npx shadcn@latest add swamimalode07/rare-ui/ai-status

How to use

"use client"
import { AiStatus, AiStatusIcon } from "@/components/ui/ai-status"
export function Status({ step }: { step: string }) {
return (
<AiStatus
state={step}
detail="12 sources"
states={{
// a custom state that reuses a built-in icon
browsing: { label: "Browsing", icon: <AiStatusIcon state="researching" /> },
// a custom state with your own svg
coding: {
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 label
done: { label: (time) => (time ? `Answered in ${time}` : "Answered"), active: false },
}}
/>
)
}

Source Code

Click the code icon in the top-right corner to view the source code.

Keep in mind

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.

Contact

Found a bug or issue? Feel free to drop a DM.

License & Usage

  • •MIT with the Commons Clause and an attribution requirement. Free to use, modify and ship in personal and commercial projects, closed source included. You own the code once it is in your project.
  • •Credit is required. Any project shipping a Rare UI component must credit Rare UI with a visible link back to rareui.com, in a footer, an about page, a credits screen or a README.
  • •Don't strip the credit or the copyright notice from the source you copied.
  • •Don't sell, sublicense or redistribute the components themselves, on their own, bundled into a template, kit, theme or paid course, or ported to another framework.
  • •Don't republish them. No mirrors, no re-uploads, no listing them as your own work.
  • •Don't repackage the registry as a competing component library.
  • •Don't claim authorship of a component or of Rare UI itself.
  • •The LICENSE file in the repository is the full text and governs. Ask first if your use doesn't fit these rules.
Inline AI Status

How do I add a Rare UI component to my project?

Thinking