Guide
Reveal
How content replaces the skeleton.
GET /postsloadingModes
| Mode | What happens |
|---|---|
fade | the content crossfades over the skeleton, the default |
sequence | each piece comes in where its skeleton was, top to bottom |
sweep | the content is uncovered from left to right |
Set it on one skeleton, or for the whole app:
<Skeleton :of="posts" :sample reveal="sequence" />
export default defineNuxtConfig({
boneprint: { reveal: 'sequence' },
})
app.use(boneprint, { reveal: 'sequence' })
With prefers-reduced-motion, every mode falls back to a plain swap.
Fast responses
A response that lands within 150 ms never shows a skeleton. Whatever is on screen waits that long before giving way, so a fast request doesn't flash. Change the wait with the --skeleton-hold CSS variable.
Images
Images never hold the content back. A photo still loading when the content appears keeps a pulsing placeholder in its box until it has loaded. Give images a width and height, or an aspect-ratio, so that box exists.