跳到正文
UIGrammer
EN 中文

动画 · 加载与进度 · 04

骨架屏

骨架屏 = 数据加载时显示与内容同形的占位块并以微光扫过,让布局看起来「马上就好」而非损坏。

直达修改 Prompt

尊重 prefers-reduced-motion:动画关闭,仅保留终态。

骨架屏是什么?

骨架屏是一种加载态:它显示内容的形状,而不是转圈。柔光扫过占位块,让等待显得更短,且布局不跳动。占位尺寸要与真实内容一致,否则加载完成时页面会偏移。

动画 标本

触发
load
技术
css
时长
1.4s
缓动
ease-in-out
性能
background-position

什么时候用

  • List, card grid, or article loading
  • Any view where content arrives after first paint

什么时候别用

  • Instant loads — a skeleton that flashes is worse than nothing
  • When you cannot match placeholder sizes to real content

Skeleton beats a spinner because it shows structure. Mismatched sizes cause a reflow jump on load.

Build a skeleton screen: grey placeholder blocks shaped like the content, with a 1.4s shimmer sweeping across via background-position. Reserve real sizes to avoid layout shift.