components/spinner
データ表示 · 24 / 64

Spinner

ui.widgets.Spinner

短い読み込み待ちのためのコンパクトなアニメーション。

BEHAVIOR CONTRACT

サイズ、色、フレームのスケジューリングはアニメーションマネージャーが一括で駆動します。

RECORDED INTERACTION

動的なフレームを残しており、静止したプレースホルダーではないことを示します。

examples/storybook/stories.zig:638
// ── Spinner ──
pub fn buildSpinner(scope: *ui.Scope, cx: *ui.Cx) anyerror!*ui.Node {
    const a = cx.allocator;
    const r = try row(cx, 20);
    // e2e 墨量断言要框到 spinner 本身:story.<key> 的 rect 还含标题/描述文字,
    // 那些文字的像素会把 spinner 画不出来这件事完全盖住(实测 7600+ dark)。
    r.meta.ownership.meta.test_id = "story.spinner.row";
    try r.appendChild(a, try W.Spinner(.{ .size = 16 }).mount(scope, cx));
    try r.appendChild(a, try W.Spinner(.{ .size = 24 }).mount(scope, cx));
    try r.appendChild(a, try W.Spinner(.{ .size = 36 }).mount(scope, cx));
    return r;
}
GitHub でソースを見るexamples/storybook/stories.zig:638

Storybook にあるこの story のコードそのままです(zenit 5f9add5+wip 2026-09-30)。W は ui.widgets のことで、col / row / label は Storybook 内の小さなレイアウトヘルパーです。

zenit · デュアルライセンスオープンソースプロジェクトは GPL-3.0-only のもとで無料で使えます。クローズドソースや商用製品には商用ライセンスが必要です。作者への連絡先:zongyi.xzy#gmail.com(# を @ に置き換え)zenit 5f9add5+wip 2026-09-30