Spinner
ui.widgets.SpinnerA compact animation for short waits.
BEHAVIOR CONTRACT
Size, color and frame scheduling are driven by the animation manager.
RECORDED INTERACTION
Keeps live frames, which shows it isn’t a static placeholder.
// ── 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;
}The story's verbatim source from the Storybook (zenit 4c50245 2026-10-01). W is ui.widgets; col / row / label are small Storybook layout helpers.
SpinnerProps
ui.widgets.Spinnerfn Spinner(props: SpinnerProps) SpinnerBuilderField
Type
Default
Description
sizef3220外径(逻辑像素)
stroke_widthf323线宽
color?Colornull弧线颜色(null = 使用主题 accent 色)
*Node
ui.widgets.Spinnermount returns *Node directly. Append it to a parent.