仕組み
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.
向いている場面
- 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.
向かない場面
- Short waits or inline places: use a spinner.
- Several at once on one screen: it is a focal motif, use one.
使い方
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>
)
}プロパティ
| プロパティ | 型 | 既定値 | 説明 |
|---|---|---|---|
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. |
アクセシビリティ
- 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.
モーション
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.
プロジェクトに追加
Pro メンバーはプロンプトをコピーし、コーディングエージェントが無料コンポーネントと同じ手順でソースを導入します。
OrbitLoader.jsxorbit-loader.csstokens.cssREADME.md
2 つのファイルを一緒に導入します。スタイルは tokens.css の変数を読み、予備の値も持つため、単体でも表示できます。





