本文へ移動
日本語
「液体プログレス」は Pro に含まれます。解除するとプレビューが表示されます。

仕組み

The fill is as wide as the pill and slides in from the left with transform: translateX, so it never animates layout; at 0 it hides 14px past the left edge. Its body is a gradient that brightens toward the front, and the front itself is a 28px column of SVG: the liquid body left of a wavy line built from three sine harmonics, a wide hazy stroke and a crisp bright stroke along it. The strip is one wave period taller than the pill and slides upward by exactly that period in a loop, so the ripple never shows a seam. There are two fronts, a calm one (2.2s per 24px period) and a lively one (0.6s per 16px period, about twice the amplitude); while the value changes they cross-fade, so the motion picks up and settles without its speed ever jumping. The number counts in JavaScript frames in step with the fill. Unlike the thin progress pill in the stat trend card, which slides in once with a smooth edge, this is a full labelled row for live work whose edge keeps moving.

向いている場面

  • Uploads, backups, syncs and exports the person is watching.
  • Several parallel jobs listed together, each in its own colour.
  • Long tasks in creative or AI tools where the wait should feel alive.

向かない場面

  • Static measures such as a quota or a score: use a meter or the stat trend card.
  • Tight table cells and toolbars: a 60px pill is too large.
  • Unknown durations with no percentage: use a spinner or the agent status pill.

使い方

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

export function Uploads({ jobs }) {
  return (
    <div style={{ display: 'grid', gap: 8 }}>
      {jobs.map((job, i) => (
        <WavyProgress
          key={job.id}
          value={job.done}
          max={job.total}
          tone={[4, 7, 6][i % 3]}
          label={job.name}
          detail={`${job.done} of ${job.total} files`}
        />
      ))}
    </div>
  )
}

プロパティ

プロパティ型既定値説明
valuenumber0Progress, from 0 to max. A new value glides from the old one and churns the front while it moves.
maxnumber100The value that means complete. At max the front settles and a check is drawn beside the number.
labelReactNode—Title of the job; a string also names the progress bar for screen readers.
detailReactNode—A second line, for example “214 of 380 photos”. Hidden in the small size.
tone1–81Chart colour of the fill and its edge.
variant'ink' | 'soft''ink'Ink is a near-black pill in both themes, where the glow reads best; soft is a light filled pill.
size'sm' | 'md''md'Height 48 or 60px.
format(value, ratio) => string—Formats the counting number instead of a percentage, for example (v) => `${Math.round(v)} MB`.
labels{ value: (percent) => string, done: string }—Replaces the built-in text: how the percentage is written and the word added to the spoken value when complete.
...restHTMLAttributes<HTMLDivElement>—Other attributes go to the root, which has role="progressbar".

アクセシビリティ

  • The root has role="progressbar" with aria-valuemin, aria-valuemax, aria-valuenow and an aria-valuetext that says the final value (and labels.done when complete), not the counting one.
  • A string label names the bar; pass aria-label when the label is not plain text.
  • The text sits above the fill and keeps its contrast: the fill only brightens toward the front.
  • The wave, haze and glow are decorative and hidden from screen readers.
  • Reduced motion shows a still wavy front, jumps the fill and the number to the new value, and draws the check at once.

モーション

Fill and number: 900ms cubic-bezier(0.22, 1, 0.36, 1), starting when the pill is 30% in view. Front: calm 2.2s per period; lively 0.6s while the value moves, cross-fading in 360ms. Check: drawn in 360ms after 120ms.

プロジェクトに追加

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

WavyProgress.jsxwavy-progress.csstokens.cssREADME.md

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

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