Boneyard Rethinks Skeleton Screens: From Hand‑Written UI to Compile‑Time Assets
The article introduces Boneyard, a tool that automatically generates skeleton screen data from real UI during the build step, eliminating the need to hand‑write placeholder components, and explains its workflow, CLI usage, supported frameworks, and how it turns loading states into compile‑time artifacts.
In the frontend world, almost everyone has written a skeleton screen at some point.
Typical approaches are either using component libraries such as Ant Design to assemble a skeleton, or hand‑coding a set of skeleton components. These methods suffer from excessive code, synchronization issues when the UI changes, and high effort for complex layouts.
Boneyard: Ditch Hand‑Written Skeletons
A recent project called Boneyard does something counter‑intuitive: it stops developers from writing Skeleton components manually and instead generates them directly from the real page.
How It Works
During the build phase Boneyard “flattens” the actual UI into skeleton data.
Core Workflow (Critical)
The process is straightforward:
Write Your Component Normally
You write the UI component as usual without any skeleton code:
<Skeleton name="user-card">
<UserCard />
</Skeleton>Run the CLI to Generate Skeleton
npx boneyard-js buildThis step launches a Playwright browser, scans the DOM, and records the position and size of every element. The result is a .bones.json file containing coordinates (x, y, width, height, radius).
UI → Coordinate data (x / y / width / height / radius)
Render at Runtime
<Skeleton name="user-card" />At runtime the component no longer depends on the original UI; it renders the stored skeleton data directly.
Quick Start
Only three steps are needed:
Install
npm install boneyard-jsWrap Your Component
<Skeleton name="card">
<Card />
</Skeleton>Generate Skeleton
npx boneyard-js buildAfter the build you can use the generated skeleton immediately.
Supported Frameworks
Boneyard is framework‑agnostic. Officially it supports React, React Native, and Svelte 5. A community version boneyard-vue adapts it for Vue.
Vue Example
<Skeleton name="card" :loading="loading">
<Card />
</Skeleton>Conclusion
Boneyard turns skeleton screens from a manual chore into a compile‑time artifact, moving UI loading states into the era of compilation.
Related Links
Boneyard website: https://boneyard.vercel.app/overview Boneyard Vue repository:
https://github.com/samuelbelo/boneyard-vueSigned-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Full-Stack Cultivation Path
Focused on sharing practical tech content about TypeScript, Vue 3, front-end architecture, and source code analysis.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
