跳到正文
UIGrammer
EN 中文

组件 · 反馈 · 19

进度条

进度条 = 已知时长用确定型进度条,未知等待用转圈,且必须配上文字标签。

直达修改 Prompt

Uploading dataset62%
Building indexDone
Waiting for the worker…

进度条是什么?

进度条告诉用户还要多久。点名轨道、填充,以及等待时长是已知还是未知。

变体

点击属性即可在预览中高亮。

在 Prompt 里写明这个类型。
在 Prompt 里写明这个类型。
在 Prompt 里写明这个类型。
给具体值,不要只给感觉词。
给具体值,不要只给感觉词。
给具体值,不要只给感觉词。
字段的名称文字,简短并置于输入框上方。
给具体值,不要只给感觉词。

状态

点击属性即可在预览中高亮。

在 Prompt 里写明这个状态。
在 Prompt 里写明这个状态。
在 Prompt 里写明这个状态。
无效状态:红色边框 + 提示文案,通常阻止提交。

结构解剖

这些是 Prompt 里应该点名的部件。

  • 01 轨道
  • 02 填充
  • 03 标签
  • 04 百分比

什么时候用

  • 已知字节数的文件上传
  • 多步流程显示第 2 / 4 步
  • 超过一秒且总量未知的等待

什么时候别用

  • 等待不足 300 毫秒——什么都别显示
  • 总量未知且等待很长——改用骨架屏
  • 阻塞页面且需要决策——改用对话框

A bar that moves but never finishes is worse than a spinner — if the total is unknown, say so with indeterminate.

Create a progress component. STYLE - 6px track #E5E5EA, 3px radius, #0071E3 fill with a 240ms width ease - a 12px label above the track naming the work, percentage on the right - a 16px indeterminate spinner variant for unknown totals - complete state swaps the fill to #34C759 for 400ms STATES - indeterminate, in progress, complete, error #FF3B30 TECHNICAL - React - Tailwind CSS - shadcn/ui