A while ago I wrote about v-skeleton , a directive that turns a real component into its own loading skeleton:
<UserCard v-skeleton= "loading" :user= "user" />
Enter fullscreen mode
Exit fullscreen mode
You don't build a second placeholder component. The directive restyles the markup you already have with CSS: text turns into bars, images and buttons turn into blocks, and the layout stays where it was. It never touches the DOM or any sizes, so nothing on the page jumps when loading ends.
I had only tested it on plain HTML fixtures I wrote myself. Most Vue apps render through a component library, though, so I put it on real Vuetify 4 and Nuxt UI 4 components ( v-card , v-list , v-table , v-chip , UCard , UBadge , UTable , UAlert ) and had a close look.
What broke
Here's the Vuetify page with real content:
And the same page with v-skeleton in 0.4.0:
At a glance it passes. Then I started counting the problems:
The icon-font icons were gone.…