Responsive

Boneyard captures your layout at multiple breakpoints automatically. The right skeleton is selected at runtime based on the container width — no media queries, no manual work.

How it works

When you run npx boneyard-js build, Playwright visits your page at multiple breakpoints and snapshots the DOM at each one. If you have Tailwind, it auto-detects your breakpoints — 375, 640, 768, 1024, 1280, 1536px. Without Tailwind, it falls back to 375, 768, 1280px. All breakpoints are stored in a single .bones.json file.

At runtime, the <Skeleton> component uses a ResizeObserver to measure its container and picks the closest breakpoint. When the window resizes, it swaps to the matching skeleton automatically.

Same component, different breakpoints

The same product card at mobile, tablet, and desktop widths. Each skeleton matches the actual layout at that size.

375pxmobile
skeleton

Wireless Headphones

Active noise cancellation, 30hr battery.

$249
768pxtablet
skeleton

Wireless Headphones

Active noise cancellation, 30hr battery. Premium comfort for all-day listening.

$249
1280pxdesktop
skeleton

Wireless Headphones

Active noise cancellation, 30hr battery life. Premium comfort designed for all-day listening with adaptive EQ.

$249$349
What the JSON looks like

Each .bones.json file contains all breakpoints in a single object. The x and w values are percentages of the container width, so they scale naturally.

dashboard.bones.json
{
  "breakpoints": {
    "375": {
      "width": 343,
      "height": 198,
      "bones": [
        [0, 0, 38.2, 17, 8],
        // ...
      ]
    },
    "768": { /* tablet bones */ },
    "1280": { /* desktop bones */ }
  }
}
Custom breakpoints

Tailwind breakpoints are auto-detected. Without Tailwind, the defaults are 375, 768, 1280. You can override them via boneyard.config.json or the CLI flag.

boneyard.config.json
{
  "breakpoints": [390, 820, 1440]
}

Or pass directly: npx boneyard-js build --breakpoints 390,820,1440

How breakpoint selection works
  • <Skeleton> measures its container width with ResizeObserver
  • Picks the largest breakpoint that fits (e.g., 500px container → uses 375px bones)
  • Updates automatically on resize — no re-render needed, just swaps the bone set
  • x and w are stored as percentages, so bones scale smoothly within a breakpoint range