跳到正文
UIGrammer
EN 中文

组件 · 反馈 · 20

骨架屏

骨架屏 = 与真实内容同形的微光占位块,在加载时替代转圈出现。

直达修改 Prompt

骨架屏是什么?

骨架屏为即将到来的内容占位。点名形状、微光动画,以及何时替代转圈。

变体

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

在 Prompt 里写明这个类型。
在 Prompt 里写明这个类型。
在 Prompt 里写明这个类型。
在 Prompt 里写明这个类型。
给具体值,不要只给感觉词。
给具体值,不要只给感觉词。
提示条自动消失前的停留时长(ms 或 s)。
给具体值,不要只给感觉词。
给具体值,不要只给感觉词。

状态

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

操作进行中显示进度并禁止重复点击,禁用控件并替换为加载指示。
在 Prompt 里写明这个状态。
无效状态:红色边框 + 提示文案,通常阻止提交。

结构解剖

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

  • 01 占位块
  • 02 微光扫过
  • 03 内容揭示

什么时候用

  • 多张卡片加载时间不一的控制面板
  • 行结构稳定的信息流与列表
  • 超过 300 毫秒且布局已知的等待

什么时候别用

  • 等待不足 300 毫秒——骨架一闪比不显示更糟
  • 最终布局未知——改用转圈
  • 内容只是很短的一串文字——显示占位横线即可

If the skeleton shape does not match the loaded content, the page jumps — draw the placeholder from the real layout, not from taste.

Create a skeleton component. STYLE - placeholders in #E5E5EA at 12px radius, shaped like the real content - a shimmer sweeps left to right in 1.2s, 8% white highlight - text lines are 12px tall with 8px gaps, the last line is 60% width - nothing appears before 300ms of loading STATES - loading with shimmer, revealing with a 160ms crossfade, error falls back TECHNICAL - React - Tailwind CSS - shadcn/ui