本文へ移動
日本語
「パーティクルオーブ」は Pro に含まれます。解除するとプレビューが表示されます。

仕組み

A 2D canvas 2.4 times the orb's size is centred on its place in the layout. Points are spread over a sphere on a golden-angle spiral; each frame turns the sphere round its vertical axis (0.55 rad/s), leans it toward the viewer and draws every point as a short round-capped stroke whose width and opacity follow its depth, over a radial core. A burst pushes each point outward by its own amount (about one in six kicks far) along a curve that rises in 130ms and springs back with a damped wave; the stroke runs from where the point was a few milliseconds earlier, so fast points leave streaks. On done the points move along an eased path to evenly spaced slots on a ring, each taking the slot nearest its angle so none cross, while the rest fade into them; then the loop stops. Colours are read from the stylesheet once per burst (accent on light surfaces; a lighter accent with additive blending in the dark theme), and the loop also pauses out of view and in hidden tabs.

向いている場面

  • An assistant composing an answer, a calculation, a plan being built.
  • Long work where a plain spinner feels mechanical: an import, a render, a search over many records.
  • A status line that should end in a clear, calm done state.

向かない場面

  • Inside buttons and dense rows: use a small spinner.
  • Measurable progress: use a progress bar or ring with a percentage.
  • Many at once on one screen: several canvases would compete for attention.

使い方

import { ParticleOrb } from './ParticleOrb.jsx'

export function AnswerStatus({ pending }) {
  return (
    <ParticleOrb
      status={pending ? 'working' : 'done'}
      labels={{ status: { working: 'Calculating…', done: 'Done' } }}
    />
  )
}

プロパティ

プロパティ型既定値説明
status'working' | 'idle' | 'done''working'Working turns the sphere and fires bursts; idle keeps it turning quietly; done settles it into a dotted ring and draws a check. Changing back from done unfolds the sphere again.
sizenumber40Diameter of the orb's place in the layout, in px. Bursts draw into a canvas 2.4 times that size without taking extra space.
particlesnumber220Number of particles, 40–600.
burstEverynumber1400Milliseconds between bursts while working.
labelReactNode—Text beside the orb. Defaults to labels.status[status].
showLabelbooleantrueShows the text beside the orb. It is still announced when hidden.
labels{ status: { working, idle, done } }—Replaces the built-in status text.
...restHTMLAttributes<HTMLDivElement>—Other attributes go to the root <div>.

アクセシビリティ

  • The status text is announced through a polite live region (role="status"); the canvas is decorative and hidden from screen readers.
  • Done is not shown by motion alone: the text changes and a check is drawn.
  • The sheen on the working text moves between the secondary and the primary text colour, so it never loses contrast.
  • Reduced motion draws a still dotted ring (fainter while working, solid when done), stops the sheen and shows the check at once.

モーション

Turn: 0.55 rad/s with a 3% breath. Burst: every 1.4s, a 130ms push and a spring back over about a second. Settle into the ring: 820ms ease-in-out; the check draws in 360ms after 560ms. Text sheen: 2.1s loop.

プロジェクトに追加

Pro メンバーはプロンプトをコピーし、コーディングエージェントが無料コンポーネントと同じ手順でソースを導入します。

ParticleOrb.jsxparticle-orb.csstokens.cssREADME.md

2 つのファイルを一緒に導入します。スタイルは tokens.css の変数を読み、予備の値も持つため、単体でも表示できます。

読み込み
「画像リビール」は Pro に含まれます。解除するとプレビューが表示されます。
「オービットローダー」は Pro に含まれます。解除するとプレビューが表示されます。