Circle Fill: a loading animation
A circle of dots that fills ring by ring, then empties. A React loader for AI agent loading states. Install with the shadcn CLI.
Installation
Install with the shadcn CLI, or copy the component file. It only needs React.
npx shadcn@latest add https://oxyn.space/r/circle-fill.jsonUsage
Updates live with the parameters you set.
import { CircleFill } from "@/components/circle-fill";
export function Thinking() {
return (
<CircleFill />
);
}Props
| Prop | Type | Default | Description |
|---|---|---|---|
| dotShape | "round"|"square" | "round" | Shape of each dot. |
| dotSize | number | 2.5 | Resting dot size in px. |
| scale | number | 1.5 | How many times larger a dot grows at the peak of the animation. |
| density | number | 11 | Dots across the width of the sheet. |
| size | number | 160 | Width and height of the orb in px. |
| duration | number | 1.2 | Seconds for the ring to cross the sheet once. It crosses twice per loop: once to fill, once to empty. |
| gap | number | 0.3 | Seconds to rest between loops. |
| ringWidth | number | 0.35 | Thickness of the ring where dots are growing or shrinking, as a fraction of the sheet radius. |
| direction | "out"|"in" | "out" | "out" fills and empties from the center to the edge; "in" from the edge to the center. |
| minOpacity | number | 0.25 | Opacity of resting dots. Dots at full size are always fully opaque. |
| color | string | "#e4e4e7" | Dot 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
Circle Fill is one of the animations in Dot Circle. Use the group when the agent's state changes, and it morphs between them.