vUX · Skeleton · placeholders shaped like the real thing

The page, before the page.

Skeleton reads the template you already wrote for your cards and draws its shape while the data is on its way: same grid, same padding, same line count. Fast loads never flash it; slow ones never flicker it.

starting…

01Derived from your template

Left, the template this page passes to both Component and Skeleton, printed from the live DOM. Middle, a card rendered from it. Right, the skeleton derived from it. Nobody wrote the right-hand one.

#postTpl

            

rendered by Component

derived by Skeleton

In the templateBecomes
data-v-fieldone bar of text, of a varying word-like width
<img> <video> <svg> <canvas> …a media block, swapped for a <span> carrying the same class and style, so your sizing still applies
<button> <input> <select> <textarea>a filled block of the control's own size
static texta bar exactly as long as the words, which stay in place, transparent
anything elsekept: your card, its padding, background and layout
data-skeleton="text:3"three lines, the last one short
data-skeleton="circle"a circle; circle:48 or circle:3rem also sizes it
data-skeleton="rect"a filled block; rect:16/9 also sets an aspect ratio
data-skeleton="media"a media block, for a <div> with a background image; media:4/3 takes a ratio
data-skeleton="keep"left exactly as written: a label that is true before the data arrives
data-skeleton="skip"left out: a badge that only some items show

02Playground

Every config property, live. Settings that change what is drawn redraw a skeleton already on screen, so press Show and then play.

config
stageidle
equivalent code

                
onShow / onHide

03Why delay and minDuration exist

Both lanes load the same thing at the same speed. The left one shows its skeleton the instant loading starts and drops it the instant data lands; the right one uses the defaults. Try a fast load, then a slow one. The bar under each lane is the skeleton's time on screen against the load.

naive: delay 0, minDuration 0
0-
defaults: delay 120, minDuration 400
0-
loading skeleton on screen on screen under 150ms: a flash

04Mask mode: refreshing what is already there

With no config.template, the skeleton masks the container's own content in place. Nothing is cloned: classes go on, text is wrapped in a span so each bar is as long as its words, and when the mask lifts the same nodes go back and the markup is byte-for-byte what it was: the status line below checks.

a live panel

Throughput is up for the third week running

The new queue absorbed Tuesday's spike without shedding a single job, and p95 latency stayed under the line all week.

12,408
jobs / hour
184ms
p95 latency
99.98%
success
markup untouched

The stat labels carry data-skeleton="keep": they are true before the refresh and after it, so masking them would only hide information the reader already has.

05What it refuses to do

Each button below misuses the API on purpose and prints the Error it throws. Mistakes are caught when the setting is made, not later inside a timer.

pick one