v0.1.0-alpha
官网Home
components/spinner
数据展示Display · 24 / 64

Spinner

ui.widgets.Spinner

短时加载状态的紧凑动画。A compact animation for short waits.

BEHAVIOR CONTRACT

尺寸、颜色和持续帧调度由动画管理器统一驱动。Size, color and frame scheduling are driven by the animation manager.

RECORDED INTERACTION

录像保留动态帧,证明不是静态占位图。Keeps live frames — proof it isn’t a static placeholder.

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 查看源码View source on GitHubexamples/storybook/stories.zig:638

这是 Storybook 中该 story 的原样代码(zenit 5f9add5+wip 2026-09-30)。其中 W 即 ui.widgets,col / row / label 是 Storybook 内的布局小工具。The story's verbatim source from the Storybook (zenit 5f9add5+wip 2026-09-30). W is ui.widgets; col / row / label are small Storybook layout helpers.

zenit · 双授权Dual-licensed开源项目可按 GPL-3.0-only 免费使用;闭源或商业产品需要商业授权。Free for open-source projects under GPL-3.0-only; closed-source or commercial products need a commercial license.可联系作者:Contact the author: zongyi.xzy#gmail.com(# 换成 @) (replace # with @)zenit 5f9add5+wip 2026-09-30