Skeleton
Feedback

Skeleton

Loading placeholders for blocks, circles, and text lines.

Props

Skeleton

Skeleton extends HTMLAttributes<HTMLSpanElement>.

SkeletonProps props
PropTypeDefaultDescription
wCSSProperties['width']"100%"Width of the placeholder.
hCSSProperties['height']10Height of the placeholder.
circleboolean—Circular placeholder shape.
roundedkeyof RadiusScale—Corner radius token. Ignored when circle.
animationSkeletonAnimation"shimmer""shimmer" | "pulse" | "none". All three go static under prefers-reduced-motion.

SkeletonText

SkeletonText extends HTMLAttributes<HTMLDivElement>.

SkeletonTextProps props
PropTypeDefaultDescription
linesnumber3Number of skeleton lines.
lastWidthCSSProperties['width']"55%"Width of the final (shortest) line.
animationSkeletonAnimation—Animation for every line.

Examples

Rectangle blocks

Skeleton rectangles

Circle (avatar placeholder)

Skeleton circle

Text skeleton

SkeletonText
ImportTSX
import { Skeleton, SkeletonText } from "@solarius/onset";

<Skeleton w="100%" h={12} />
<Skeleton w={36} h={36} circle />
<SkeletonText lines={4} lastWidth="45%" />