Cómo funciona
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.
Úsalo para
- 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.
Busca otra opción cuando
- Short waits or inline places: use a spinner.
- Several at once on one screen: it is a focal motif, use one.
Uso
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>
)
}Propiedades
| Propiedad | Tipo | Por defecto | Qué hace |
|---|---|---|---|
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. |
Accesibilidad
- 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.
Movimiento
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.
Añádelo a tu proyecto
Los miembros Pro copian un prompt y su agente de programación instala el código, igual que con los gratuitos.
OrbitLoader.jsxorbit-loader.csstokens.cssREADME.md
Los dos archivos se instalan juntos. La hoja de estilos lee las variables de tokens.css y lleva valores de reserva, así que también funciona sola.





