Skeleton
Show a placeholder while content is loading.
Use Skeleton to reserve space for content while it loads. Match the placeholder’s dimensions and shape to the content it will replace.
Basic usage#
Playground#
Anatomy#
Usage#
Size and appearance#
Skeleton renders one <div> with a muted background, medium corners, and a pulse animation. Set its dimensions with class or an object style, and use utilities such as rounded-full to change its shape. Native div attributes and children are forwarded to the root.
Animation variants#
The default variant="pulse" fades the placeholder in and out. Use variant="shimmer" for a linear gradient sweep across the placeholder. Both animations respect the user’s reduced-motion preference.
Shimmer uses Moraine’s loop duration, which defaults to two seconds. Set --mo-anim-duration-loop or --mo-anim-duration in style to change its speed. Configure skeleton.defaultVariants.variant in your Theme to set the default animation across your application.
Examples#
Avatar#
Card#
Text#
Form#
Table#
Props#
Renders a <div> element by default.