Bar Comet: a loader for thinking and tool use
Thin bars round a circle with a bright head trailing a fading tail. A React loader for an AI agent thinking or running a tool.
Installation
Install with the shadcn CLI, or copy the component file. It only needs React.
npx shadcn@latest add https://oxyn.space/r/bar-comet.jsonUsage
Updates live with the parameters you set.
import { BarComet } from "@/components/bar-comet";
export function Thinking() {
return (
<BarComet />
);
}Props
| Prop | Type | Default | Description |
|---|---|---|---|
| bars | number | 36 | Number of bars around the ring. |
| barHeight | number | 12 | Resting height of each bar in px, pointing away from the center. |
| barWidth | number | 2 | Thickness of each bar in px. Capped so neighbors never overlap. |
| radius | number | 1 | Corner radius of each bar in px. |
| extend | number | 10 | How far the comet's head grows a bar in px. The end away from the push never moves. |
| duration | number | 0.5 | Seconds one bar takes to snap out and fade back: the length of the tail. |
| stagger | number | 0.05 | Seconds between one bar starting and the next, going clockwise. |
| direction | "out"|"in" | "out" | Which way the push carries a bar: away from the center, or toward it. |
| size | number | 160 | Width and height of the orb in px. |
| minOpacity | number | 0.35 | Opacity of resting bars. Bars at the peak of the wave are always fully opaque. |
| color | string | "#e4e4e7" | Bar color. |
| paused | boolean | false | Coast to a stop on the current frame without unmounting. Turning it off eases back up to speed. |
| label | string | "Thinking" | Accessible name; the wrapper is role="status". |
| className / style | — | — | Spread onto the wrapper div, along with any other div props. |
Switch states
Bar Comet is one of the animations in Bar Ring. Use the group when the agent's state changes, and it morphs between them.