Components
Provide a placeholder while you wait for content to load, or to visualise content that doesn't exist yet.
Placeholders can be used to enhance the experience of your application. They're built only with HTML and CSS, meaning you don't need any JavaScript to create them. You will, however, need some custom JavaScript to toggle their visibility. Their appearance, color, and sizing can be easily customized with our utility classes.
Simplest Skeleton usage.
<h3 class="h-4 bg-gray-200 rounded-md dark:bg-gray-700" style="width: 40%;"></h3>
<ul class="mt-5 space-y-3">
<li class="w-full h-4 bg-gray-200 rounded-md dark:bg-gray-700"></li>
<li class="w-full h-4 bg-gray-200 rounded-md dark:bg-gray-700"></li>
<li class="w-full h-4 bg-gray-200 rounded-md dark:bg-gray-700"></li>
<li class="w-full h-4 bg-gray-200 rounded-md dark:bg-gray-700"></li>
</ul>
Complex combination with avatar and multiple paragraphs.
<div class="flex">
<div class="flex-shrink-0">
<span class="w-12 h-12 block bg-gray-200 rounded-full dark:bg-gray-700"></span>
</div>
<div class="ml-4 mt-2 w-full">
<h3 class="h-4 bg-gray-200 rounded-md dark:bg-gray-700" style="width: 40%;"></h3>
<ul class="mt-5 space-y-3">
<li class="w-full h-4 bg-gray-200 rounded-md dark:bg-gray-700"></li>
<li class="w-full h-4 bg-gray-200 rounded-md dark:bg-gray-700"></li>
<li class="w-full h-4 bg-gray-200 rounded-md dark:bg-gray-700"></li>
<li class="w-full h-4 bg-gray-200 rounded-md dark:bg-gray-700"></li>
</ul>
</div>
</div>
Display active animation.
<div class="flex animate-pulse">
<div class="flex-shrink-0">
<span class="w-12 h-12 block bg-gray-200 rounded-full dark:bg-gray-700"></span>
</div>
<div class="ml-4 mt-2 w-full">
<h3 class="h-4 bg-gray-200 rounded-md dark:bg-gray-700" style="width: 40%;"></h3>
<ul class="mt-5 space-y-3">
<li class="w-full h-4 bg-gray-200 rounded-md dark:bg-gray-700"></li>
<li class="w-full h-4 bg-gray-200 rounded-md dark:bg-gray-700"></li>
<li class="w-full h-4 bg-gray-200 rounded-md dark:bg-gray-700"></li>
<li class="w-full h-4 bg-gray-200 rounded-md dark:bg-gray-700"></li>
</ul>
</div>
</div>