Skeletons
Text, shapes, profile, card, list and table placeholders shown while content loads.
Text
A heading and a paragraph. Use lines of different widths and make the last one shorter, as in real text.
<div id="skeleton-1507" class="max-w-md" role="status" aria-busy="true">
<span class="sr-only">Loading the article</span>
<div aria-hidden="true">
<div class="space-y-3">
<div
class="bg-dominant-200 dark:bg-dominant-700 motion-safe:animate-pulse h-5 w-2/5 rounded"
></div>
<div
class="bg-dominant-200 dark:bg-dominant-700 motion-safe:animate-pulse h-3.5 w-full rounded"
></div>
<div
class="bg-dominant-200 dark:bg-dominant-700 motion-safe:animate-pulse h-3.5 w-full rounded"
></div>
<div
class="bg-dominant-200 dark:bg-dominant-700 motion-safe:animate-pulse h-3.5 w-3/4 rounded"
></div>
</div>
</div>
</div>
Shapes
A skeleton is a grey block in the place where content will appear. It is only a div with a background and motion-safe:animate-pulse: a line, a circle, a rectangle and a button. With less motion it stays still. Draw the shapes the same size as the real content, so the page does not move when it arrives.
<div id="skeleton-1508" class role="status" aria-busy="true">
<span class="sr-only">Loading</span>
<div aria-hidden="true">
<div class="flex flex-wrap items-center gap-6">
<div
class="bg-dominant-200 dark:bg-dominant-700 motion-safe:animate-pulse h-4 w-48 rounded"
></div>
<div
class="bg-dominant-200 dark:bg-dominant-700 motion-safe:animate-pulse size-10 rounded-full"
></div>
<div
class="bg-dominant-200 dark:bg-dominant-700 motion-safe:animate-pulse h-24 w-40 rounded-lg"
></div>
<div
class="bg-dominant-200 dark:bg-dominant-700 motion-safe:animate-pulse h-10 w-28 rounded-lg"
></div>
</div>
</div>
</div>
Profile
An avatar with two lines, for a user or a comment.
<div id="skeleton-1509" class="max-w-sm" role="status" aria-busy="true">
<span class="sr-only">Loading</span>
<div aria-hidden="true">
<div class="flex items-center gap-3">
<div
class="bg-dominant-200 dark:bg-dominant-700 motion-safe:animate-pulse size-10 shrink-0 rounded-full"
></div>
<div class="flex-1 space-y-2">
<div
class="bg-dominant-200 dark:bg-dominant-700 motion-safe:animate-pulse h-3.5 w-1/3 rounded"
></div>
<div
class="bg-dominant-200 dark:bg-dominant-700 motion-safe:animate-pulse h-3 w-1/2 rounded"
></div>
</div>
</div>
</div>
</div>
Card
An image, a title, two lines and a button inside the same border as a real card.
<div
id="skeleton-1510"
class="max-w-xs rounded-xl border border-dominant-200 dark:border-dominant-800 p-4"
role="status"
aria-busy="true"
>
<span class="sr-only">Loading</span>
<div aria-hidden="true">
<div class="space-y-4">
<div
class="bg-dominant-200 dark:bg-dominant-700 motion-safe:animate-pulse h-40 w-full rounded-lg"
></div>
<div class="space-y-2">
<div
class="bg-dominant-200 dark:bg-dominant-700 motion-safe:animate-pulse h-5 w-2/3 rounded"
></div>
<div
class="bg-dominant-200 dark:bg-dominant-700 motion-safe:animate-pulse h-3.5 w-full rounded"
></div>
<div
class="bg-dominant-200 dark:bg-dominant-700 motion-safe:animate-pulse h-3.5 w-5/6 rounded"
></div>
</div>
<div
class="bg-dominant-200 dark:bg-dominant-700 motion-safe:animate-pulse h-10 w-28 rounded-lg"
></div>
</div>
</div>
</div>
List
Repeat the same row for a list. Four to six rows are enough: the person does not need to see as many rows as the page will have.
<div id="skeleton-1511" class="max-w-md" role="status" aria-busy="true">
<span class="sr-only">Loading</span>
<div aria-hidden="true">
<div class="divide-y divide-dominant-200 dark:divide-dominant-800">
<div class="py-3">
<div class="flex items-center gap-3">
<div
class="bg-dominant-200 dark:bg-dominant-700 motion-safe:animate-pulse size-10 shrink-0 rounded-full"
></div>
<div class="flex-1 space-y-2">
<div
class="bg-dominant-200 dark:bg-dominant-700 motion-safe:animate-pulse h-3.5 w-1/3 rounded"
></div>
<div
class="bg-dominant-200 dark:bg-dominant-700 motion-safe:animate-pulse h-3 w-1/2 rounded"
></div>
</div>
</div>
</div>
<div class="py-3">
<div class="flex items-center gap-3">
<div
class="bg-dominant-200 dark:bg-dominant-700 motion-safe:animate-pulse size-10 shrink-0 rounded-full"
></div>
<div class="flex-1 space-y-2">
<div
class="bg-dominant-200 dark:bg-dominant-700 motion-safe:animate-pulse h-3.5 w-1/3 rounded"
></div>
<div
class="bg-dominant-200 dark:bg-dominant-700 motion-safe:animate-pulse h-3 w-1/2 rounded"
></div>
</div>
</div>
</div>
<div class="py-3">
<div class="flex items-center gap-3">
<div
class="bg-dominant-200 dark:bg-dominant-700 motion-safe:animate-pulse size-10 shrink-0 rounded-full"
></div>
<div class="flex-1 space-y-2">
<div
class="bg-dominant-200 dark:bg-dominant-700 motion-safe:animate-pulse h-3.5 w-1/3 rounded"
></div>
<div
class="bg-dominant-200 dark:bg-dominant-700 motion-safe:animate-pulse h-3 w-1/2 rounded"
></div>
</div>
</div>
</div>
<div class="py-3">
<div class="flex items-center gap-3">
<div
class="bg-dominant-200 dark:bg-dominant-700 motion-safe:animate-pulse size-10 shrink-0 rounded-full"
></div>
<div class="flex-1 space-y-2">
<div
class="bg-dominant-200 dark:bg-dominant-700 motion-safe:animate-pulse h-3.5 w-1/3 rounded"
></div>
<div
class="bg-dominant-200 dark:bg-dominant-700 motion-safe:animate-pulse h-3 w-1/2 rounded"
></div>
</div>
</div>
</div>
</div>
</div>
</div>
Table
Rows for a table that loads from a server. The columns have the same grid as the finished table. The table is scrolled sideways on a narrow screen, as it will be when it is real.
<div
id="skeleton-1512"
class="overflow-x-auto rounded-lg border border-dominant-200 dark:border-dominant-800"
role="status"
aria-busy="true"
>
<span class="sr-only">Loading</span>
<div aria-hidden="true">
<div>
<div
class="grid grid-cols-[2fr_1fr_1fr_1fr] items-center gap-4 px-4 py-3 border-b border-dominant-200 dark:border-dominant-800"
>
<div
class="bg-dominant-200 dark:bg-dominant-700 motion-safe:animate-pulse h-3 w-2/3 rounded"
></div>
<div
class="bg-dominant-200 dark:bg-dominant-700 motion-safe:animate-pulse h-3 w-2/3 rounded"
></div>
<div
class="bg-dominant-200 dark:bg-dominant-700 motion-safe:animate-pulse h-3 w-2/3 rounded"
></div>
<div
class="bg-dominant-200 dark:bg-dominant-700 motion-safe:animate-pulse h-3 w-2/3 rounded"
></div>
</div>
<div
class="grid grid-cols-[2fr_1fr_1fr_1fr] items-center gap-4 px-4 py-4 border-b border-dominant-200 dark:border-dominant-800 last:border-b-0"
>
<div class="flex items-center gap-3">
<div
class="bg-dominant-200 dark:bg-dominant-700 motion-safe:animate-pulse size-8 shrink-0 rounded-full"
></div>
<div
class="bg-dominant-200 dark:bg-dominant-700 motion-safe:animate-pulse h-3.5 w-24 rounded"
></div>
</div>
<div
class="bg-dominant-200 dark:bg-dominant-700 motion-safe:animate-pulse h-3.5 w-16 rounded"
></div>
<div
class="bg-dominant-200 dark:bg-dominant-700 motion-safe:animate-pulse h-5 w-14 rounded-full"
></div>
<div
class="bg-dominant-200 dark:bg-dominant-700 motion-safe:animate-pulse h-3.5 w-12 rounded"
></div>
</div>
<div
class="grid grid-cols-[2fr_1fr_1fr_1fr] items-center gap-4 px-4 py-4 border-b border-dominant-200 dark:border-dominant-800 last:border-b-0"
>
<div class="flex items-center gap-3">
<div
class="bg-dominant-200 dark:bg-dominant-700 motion-safe:animate-pulse size-8 shrink-0 rounded-full"
></div>
<div
class="bg-dominant-200 dark:bg-dominant-700 motion-safe:animate-pulse h-3.5 w-24 rounded"
></div>
</div>
<div
class="bg-dominant-200 dark:bg-dominant-700 motion-safe:animate-pulse h-3.5 w-16 rounded"
></div>
<div
class="bg-dominant-200 dark:bg-dominant-700 motion-safe:animate-pulse h-5 w-14 rounded-full"
></div>
<div
class="bg-dominant-200 dark:bg-dominant-700 motion-safe:animate-pulse h-3.5 w-12 rounded"
></div>
</div>
<div
class="grid grid-cols-[2fr_1fr_1fr_1fr] items-center gap-4 px-4 py-4 border-b border-dominant-200 dark:border-dominant-800 last:border-b-0"
>
<div class="flex items-center gap-3">
<div
class="bg-dominant-200 dark:bg-dominant-700 motion-safe:animate-pulse size-8 shrink-0 rounded-full"
></div>
<div
class="bg-dominant-200 dark:bg-dominant-700 motion-safe:animate-pulse h-3.5 w-24 rounded"
></div>
</div>
<div
class="bg-dominant-200 dark:bg-dominant-700 motion-safe:animate-pulse h-3.5 w-16 rounded"
></div>
<div
class="bg-dominant-200 dark:bg-dominant-700 motion-safe:animate-pulse h-5 w-14 rounded-full"
></div>
<div
class="bg-dominant-200 dark:bg-dominant-700 motion-safe:animate-pulse h-3.5 w-12 rounded"
></div>
</div>
<div
class="grid grid-cols-[2fr_1fr_1fr_1fr] items-center gap-4 px-4 py-4 border-b border-dominant-200 dark:border-dominant-800 last:border-b-0"
>
<div class="flex items-center gap-3">
<div
class="bg-dominant-200 dark:bg-dominant-700 motion-safe:animate-pulse size-8 shrink-0 rounded-full"
></div>
<div
class="bg-dominant-200 dark:bg-dominant-700 motion-safe:animate-pulse h-3.5 w-24 rounded"
></div>
</div>
<div
class="bg-dominant-200 dark:bg-dominant-700 motion-safe:animate-pulse h-3.5 w-16 rounded"
></div>
<div
class="bg-dominant-200 dark:bg-dominant-700 motion-safe:animate-pulse h-5 w-14 rounded-full"
></div>
<div
class="bg-dominant-200 dark:bg-dominant-700 motion-safe:animate-pulse h-3.5 w-12 rounded"
></div>
</div>
<div
class="grid grid-cols-[2fr_1fr_1fr_1fr] items-center gap-4 px-4 py-4 border-b border-dominant-200 dark:border-dominant-800 last:border-b-0"
>
<div class="flex items-center gap-3">
<div
class="bg-dominant-200 dark:bg-dominant-700 motion-safe:animate-pulse size-8 shrink-0 rounded-full"
></div>
<div
class="bg-dominant-200 dark:bg-dominant-700 motion-safe:animate-pulse h-3.5 w-24 rounded"
></div>
</div>
<div
class="bg-dominant-200 dark:bg-dominant-700 motion-safe:animate-pulse h-3.5 w-16 rounded"
></div>
<div
class="bg-dominant-200 dark:bg-dominant-700 motion-safe:animate-pulse h-5 w-14 rounded-full"
></div>
<div
class="bg-dominant-200 dark:bg-dominant-700 motion-safe:animate-pulse h-3.5 w-12 rounded"
></div>
</div>
</div>
</div>
</div>