components/progress
데이터 표시 · 23 / 64

Progress

ui.widgets.Progress

확정 진행률과 불확정 작업 상태.

BEHAVIOR CONTRACT

백분율, status, height, 불확정 애니메이션을 하나의 컴포넌트로 표현합니다.

RECORDED INTERACTION

25 / 60 / 100, error, 불확정 상태를 보여 줍니다.

examples/storybook/stories.zig:617
// ── Progress ──
pub fn buildProgress(scope: *ui.Scope, cx: *ui.Cx) anyerror!*ui.Node {
    const a = cx.allocator;
    const c = try col(cx, 16);
    try c.appendChild(a, try label(cx, "Values 25% / 60% / 100%"));
    try c.appendChild(a, try W.Progress(.{ .value = 25, .width = 320, .show_text = true }).mount(scope, cx));
    try c.appendChild(a, try W.Progress(.{ .value = 60, .width = 320, .show_text = true }).mount(scope, cx));
    try c.appendChild(a, try W.Progress(.{ .value = 100, .width = 320, .status = .success, .show_text = true }).mount(scope, cx));

    try c.appendChild(a, try label(cx, "Heights (2 / 4 / 8 / 12)"));
    inline for (.{ 2, 4, 8, 12 }) |h| {
        try c.appendChild(a, try W.Progress(.{ .value = 50, .width = 320, .height = @as(f32, h) }).mount(scope, cx));
    }

    try c.appendChild(a, try label(cx, "Error / indeterminate / no-text"));
    try c.appendChild(a, try W.Progress(.{ .value = 40, .width = 320, .status = .@"error", .show_text = true }).mount(scope, cx));
    try c.appendChild(a, try W.Progress(.{ .indeterminate = true, .width = 320 }).mount(scope, cx));
    try c.appendChild(a, try W.Progress(.{ .value = 70, .width = 320, .show_text = false }).mount(scope, cx));
    return c;
}
GitHub에서 소스 보기examples/storybook/stories.zig:617

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