How it works
Each orbit is a plane rotated with rotateZ then rotateX inside one preserve-3d context. A spinner turns in the plane and carries the particles; each particle undoes the spin and the tilt so it stays round and faces the viewer. The core is a flat disc at z = 0 in the same context, so particles are hidden as they pass behind it. Orbits have unrelated periods (3.2s, 2.5s, 4.1s, 2.1s), so the pattern never visibly repeats.
Use it for
- Open-ended waits of several seconds or more: generating an answer, rendering, an import.
- An empty state while a background job runs, paired with a changing status line.
Look elsewhere when
- Short waits or inline places: use a spinner.
- Several at once on one screen: it is a focal motif, use one.
Usage
import { OrbitLoader } from './OrbitLoader.jsx'
export function Thinking({ step }) {
return (
<OrbitLoader size={150} orbits={3} label="Preparing an answer">
<span key={step}>{step}</span>
</OrbitLoader>
)
}Props
| Prop | Type | Default | What it does |
|---|---|---|---|
variant | 'particles' | 'rings' | 'particles' | Particles on faint orbits, or comet arcs sweeping brighter rings. |
size | number | 160 | Stage size in px; everything scales from it. |
orbits | number | 3 | 1 to 4 orbits, each with its own tilt, period and colour. |
particles | number | 2 | Particles per orbit (1 to 4), spaced evenly and slightly smaller each. |
speed | number | 1 | Multiplies every period. |
label | string | 'Working' | Accessible name of the drawing. |
children | ReactNode | — | Status line under the stage, in a polite live region. Give it a key per step so each new line rises in. |
...rest | HTMLAttributes<HTMLDivElement> | — | Passed to the root. Colours come from --ds-accent, --ds-tertiary and --ds-secondary. |
Accessibility
- The drawing is role="img" with a label; the status line is a polite live region, so each new step is announced once.
- It contains no controls. Offer a visible Stop or Cancel next to it for long tasks.
- Reduced motion stops all orbiting; particles rest on their orbits, the glow fades gently, and new status lines only fade in.
Motion
Particles circle at constant speed (linear is right for orbits) with periods of 2.1 to 4.1s. The core and glow breathe between 0.94 and 1.04 over 3.2s. Status lines rise 6px from a 2px blur in 420ms ease-out.
Add it to your project
Pro members copy a prompt and their coding agent installs the source, the same way as the free components.
OrbitLoader.jsxorbit-loader.csstokens.cssREADME.md
Both files install together. The stylesheet reads the design tokens in tokens.css and carries fallbacks, so it also works alone.





