Skip to content

Skeleton 骨架屏

加载占位组件,对齐 Ant Design Skeleton。

示例

可访问性

Skeleton 加载态默认渲染为 role="status" 的 polite live region,并通过 aria-busy="true" 标记内容仍在加载。视觉占位块会从辅助技术中隐藏;当页面中存在多个骨架屏时,建议通过 aria-labelaria-labelledby 提供可区分名称。

API

属性说明类型默认值
active是否展示动画booleantrue
avatar显示头像占位booleanfalse
title显示标题占位booleantrue
paragraph显示段落占位boolean | { rows?: number }true
loading为 true 时显示骨架屏,否则显示 childrenbooleantrue
aria-label骨架屏加载状态可访问名称string'Loading content'
aria-labelledby使用外部标签命名骨架屏加载状态string-
aria-live加载状态通知优先级'off' | 'polite' | 'assertive''polite'