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.
rendered by Component
derived by Skeleton
| In the template | Becomes |
|---|---|
| data-v-field | one 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 text | a bar exactly as long as the words, which stay in place, transparent |
| anything else | kept: 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.
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.
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.
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.
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