安装
pnpm dlx shadcn@latest add https://loading.design/r/text-skeleton.json用法
import { TextSkeleton } from "@/components/loading/text-skeleton"
<TextSkeleton lines={4} lastLineWidth="68%" animated={true} />API
| 属性 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| lines | number | 3 | 占位文本的行数。 |
| lastLineWidth | `${number}%` | 68% | 最后一行的宽度,用于模拟自然段落末行。 |
| animated | boolean | true | 是否应用轻微的透明度脉冲。 |
无障碍
骨架占位内容对辅助技术隐藏。请为它代表的区域设置 aria-busy,并保持该区域的无障碍名称稳定。