Skip to content

Skeleton

A placeholder component used to indicate that content is loading. Skeletons provide a visual cue to users, reducing perceived wait times and improving the overall experience.

Usage

Use skeletons to temporarily fill the space of content that is being fetched or rendered. Make sure the placeholder visually resembles the final content layout to maintain context. Avoid overusing skeletons for static or instant-loading content, as this can create unnecessary visual noise.

API Reference

Component attubute(s)

x-h-skeleton

Modifiers

ModifierDescription
controlTakes the shape of a control (like inputs and buttons).
cardTakes the shape of a card or tile.
avatarTakes the shape of an avatar component.

Attributes

AttributeTypeRequiredDescription
data-sizesm
md
default
falseHeight of the skeleton. Works only when combined with the control modifier.

Examples

html
<div class="flex flex-col gap-2">
  <div x-h-skeleton.avatar></div>
  <div x-h-skeleton.card class="tile-xs"></div>
  <div x-h-skeleton.control class="w-1/2"></div>
  <div x-h-skeleton class="h-12 w-full"></div>
</div>