Spinner
ui.widgets.SpinnerEine kompakte Animation für kurze Wartezeiten.
BEHAVIOR CONTRACT
Größe, Farbe und Frame-Planung steuert der Animationsmanager.
RECORDED INTERACTION
Enthält echte Frames – der Beweis, dass es kein statischer Platzhalter ist.
// ── 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;
}Der unveränderte Quellcode der Story aus dem Storybook (zenit 5f9add5+wip 2026-09-30). W steht für ui.widgets; col / row / label sind kleine Layout-Helfer des Storybooks.
SpinnerProps
ui.widgets.Spinnerfn Spinner(props: SpinnerProps) SpinnerBuilderFeld
Typ
Standard
Beschreibung
sizef3220外径(逻辑像素)
stroke_widthf323线宽
color?Colornull弧线颜色(null = 使用主题 accent 色)
*Node
ui.widgets.Spinnermount gibt *Node direkt zurück – hängen Sie es an einen Elternknoten an.