Star 历史趋势
数据来源: GitHub API · 生成自 Stargazers.cn
README.md

Boneyard

boneyard

Pixel-perfect skeleton loading screens, extracted from your real DOM. No manual measurement, no hand-tuned placeholders.

How it works

  1. Wrap your component with <Skeleton> and give it a name
  2. Run npx boneyard-js build — it snapshots the DOM and generates bones
  3. Import the registry once — every skeleton auto-resolves
import { Skeleton } from 'boneyard-js/react' function BlogPage() { const { data, isLoading } = useFetch('/api/post') return ( <Skeleton name="blog-card" loading={isLoading}> {data && <BlogCard data={data} />} </Skeleton> ) }
npx boneyard-js build
// app/layout.tsx — add once import './bones/registry'

Done. Every <Skeleton name="..."> shows a pixel-perfect skeleton on load.

Install

npm install boneyard-js

What it does

  • Reads getBoundingClientRect() on every visible element in your component
  • Stores positions as a flat array of { x, y, w, h, r } bones
  • Renders them as gray rectangles that match your real layout exactly
  • Responsive — captures at multiple breakpoints (375px, 768px, 1280px by default)
  • Pulse animation shimmers to a lighter shade of whatever color you set

Props

PropTypeDefaultDescription
namestringrequiredUnique name for this skeleton
loadingbooleanrequiredShow skeleton or real content
colorstring#e0e0e0Bone fill color
animatebooleantruePulse animation
snapshotConfigobjectControl which elements are included

CLI

npx boneyard-js build # auto-detect dev server npx boneyard-js build http://localhost:3000 npx boneyard-js build --breakpoints 390,820,1440 --out ./public/bones

Links

Star History

Star History Chart

License

MIT

关于 About

Auto generated skeleton loading framework

语言 Languages

TypeScript92.7%
JavaScript6.6%
CSS0.7%

提交活跃度 Commit Activity

代码提交热力图
过去 52 周的开发活跃度
30
Total Commits
峰值: 30次/周
Less
More

核心贡献者 Contributors