Circle Breath
2DA flat circle of dots that grows and shrinks together, one slow inhale and exhale per loop. Add ripple and the center breathes a beat before the edge.
circle-breath.tsx
Installation
Install with the shadcn CLI, or copy the component file. It only needs React.
npx shadcn@latest add https://your-domain.com/r/circle-breath.jsonUsage
Updates live with the parameters you set.
import { CircleBreath } from "@/components/circle-breath";
export function Thinking() {
return (
<CircleBreath />
);
}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 | 2.4 | Seconds for one full breath (grow, then shrink). |
| gap | number | 0.2 | Seconds to rest between breaths. |
| ripple | number | 0 | Seconds the edge lags behind the center. 0 breathes in sync. |
| 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. |