shadcn.io is an independent project built on shadcn/ui
On this page9 sections
A skeleton is a muted block that pulses where content will appear: a circle for an avatar, bars for a name and a line of text, rows for a table. Sized like what's coming, it holds the layout steady while data loads, so nothing jumps when the real content takes its place.
When you can't predict the shape, or the wait belongs to a button, use a Spinner. For work with a known amount, a Progress bar says how much is left.
Installation
Anatomy

Usage
<script setup lang="ts">
import { Skeleton } from "@/components/ui/skeleton";
</script>
<template>
<div class="flex items-center gap-4">
<Skeleton class="h-12 w-12 rounded-full" />
<div class="space-y-2">
<Skeleton class="h-4 w-[250px]" />
<Skeleton class="h-4 w-[200px]" />
</div>
</div>
</template>
Skeleton has no size of its own. Each block takes its height, width and, for the avatar, its round shape from the classes you give it.
Accessibility
Skeleton is an empty div with no role or text, so a screen reader passes over it and says nothing about the wait. That part is yours. Set aria-busy to true on the region that's loading and give it a short status, such as visually hidden text reading "Loading orders", then remove both when the data lands. For the status to be announced, not only found by someone reading through the page, put it in an element with role="status" that is already rendered when its text changes.
The pulse is Tailwind's animate-pulse, with motion-reduce:animate-none beside it, so the blocks hold still when the system asks for reduced motion.
Demos
Avatar
A 40-pixel circle with two bars beside it, 150 and 100 pixels wide, standing in for a person's name and a line under it. Use it for a comment, a member list or an account menu while the profile loads. Size the circle to the real avatar and the bars to a typical name, so the swap doesn't shift the row.
Loading state
A 48-pixel circle and two bars hold the place of a profile for a second and a half, then give way to the initials, a name and a job title, and Reload starts over. While it waits, the row has aria-busy set and a visually hidden role="status" line reads "Loading profile". Copy it when screen reader users should hear the wait too.
Card
Inside a Card, two header bars at two thirds and half the width stand in for a title and a description, above a full-width block at a 16:9 ratio for the image. Use it while a post or a product preview is fetched and you know it carries a picture. The card itself renders as it will with data, so only what's inside it changes when the content lands.
Text
Three bars for a paragraph, two at full width and the last at three quarters, so the block ends the way real text does instead of as a box. Each bar is 16 pixels tall, with 8 between them. Use it for a bio, a comment body or a product description. SkeletonText renders the same stack, with the count set by lines.
Form
Two fields, each a short bar for the label over a 32-pixel-tall bar for the input, then a bar 96 pixels wide where the submit button goes. Use it while a settings form waits on the values it will be filled with. Keep the gaps the finished form has, 28 pixels between fields here, so the inputs land where their placeholders were.
Table
Five rows of three bars each: a first column that takes the spare width, then two fixed ones at 96 and 80 pixels. Use it under a table header you've already rendered, while the records load. Match the bar widths to the real columns, so header and rows line up when the data arrives.
RTL
The row from the top of this page under dir set to rtl: the 48-pixel circle sits on the right and the two bars line up from the right edge. Skeleton has no direction of its own, since the flex row follows dir and the pulse has nothing to mirror. Write any spacing you add around the blocks with logical utilities such as ms-4, so it flips with the row.
FAQ
How do I make a multi-line text Skeleton in Vue?
Use SkeletonText and set lines to the number of lines, 2 by default. It renders 16-pixel bars, 8 pixels apart, and makes the last one three quarters wide so the block ends like a paragraph. For another line height, stack Skeleton bars yourself as the Text demo does, sized so the block comes out as tall as the text it replaces.
How do I make a circular avatar Skeleton?
Use SkeletonCircle, a 40-pixel round block that won't shrink in a flex row. A size class on it, such as size-8, overrides the 40 pixels to match the real avatar. The Avatar demo builds the same shape from a plain Skeleton with two bars beside it for the name and subtitle.
How do I replace a Skeleton with the real content when data loads?
Render the skeleton under v-if while the data is missing and the content under v-else once it arrives. With an async component inside Suspense, put the skeleton in its fallback slot instead, and Vue swaps it out when the component resolves.
Why does my page still jump when the Skeleton is replaced?
The blocks aren't the size of what replaces them. Three h-4 bars with gap-2 between them stand 64 pixels tall, while three lines of text at a 20-pixel line height take 60, and an image block with no height or aspect ratio collapses to nothing, because Skeleton has no size of its own. Five placeholder rows in front of twenty real ones push everything below them down too.
Copy the real layout's sizes onto the skeleton: the text's line height, aspect-video or the image's own ratio, and a row count close to a typical page. The Card demo keeps its media block at 16:9 for this reason.
When should I use a Skeleton instead of a Spinner?
Use a Skeleton when you know the shape of what's loading, a feed, a profile or a table, and want the page to look settled before the data arrives. A Spinner fits a button that's submitting, a region whose size you can't predict, or a wait so short that drawing a skeleton would only flash on screen.
Neither says how much is left. When the work has a number, use a Progress bar.
Should a Skeleton be hidden from screen readers?
There's nothing to hide. Skeleton is an empty div with no role or text, so screen readers already skip it, and aria-hidden on it changes nothing.
The real gap is the opposite: nobody hears that content is loading. Set aria-busy on the region while it loads and give it a short status in an element with role="status", such as visually hidden text reading "Loading comments", then clear both when the skeleton goes, as the Loading state demo does.
How do I change the Skeleton color or animation?
The installed Skeleton carries bg-muted, your style's rounding and Tailwind's animate-pulse, which fades the block to half opacity and back every 2 seconds. Change a single block with its own classes, such as bg-primary/10 or rounded-full.
To change every skeleton, edit that file: swap the background, or replace animate-pulse with an animation of your own and keep motion-reduce:animate-none beside it, which stops the motion for people who ask their system for less.
API Reference
Skeleton
<div> data-slot="skeleton"
asChild?boolean
Use the provided child element as the default rendered element, combining their props and behavior.
class?string
Merged with the part's classes.
SkeletonCircle
<div> data-slot="skeleton-circle"
asChild?boolean
Use the provided child element as the default rendered element, combining their props and behavior.
class?string
Merged with the part's classes.
SkeletonText
<div> data-slot="skeleton-text"
lines?number
The number of lines of the skeleton text.
- Default
2
asChild?boolean
Use the provided child element as the default rendered element, combining their props and behavior.
class?string
Merged with the part's classes.











