Skeleton
Display a placeholder preview of your content before the data gets loaded to reduce load-time frustration.
Import
Usage
Variants
This component provides 3 shape variants: text
, rect
, and circle
.
EDITABLE EXAMPLE
Animations
The animation is disabled by default. You can change the animation effect to pulse
or wave
.
EDITABLE EXAMPLE
Inferring dimensions
In addition to accepting width
and height
props, the component can also infer the dimensions.
EDITABLE EXAMPLE
Props
Name | Type | Default | Description |
---|---|---|---|
variant | string | 'text' | The type of content that will be rendered. One of: 'text' , 'rect' , 'circle' |
animation | string | The animation effect. One of: 'pulse' , 'wave' | |
width | number | string | Width of the skeleton. Useful when the skeleton is inside an inline element with no width of its own. | |
height | number | string | Height of the skeleton. Useful when you don't want to adopt the skeleton to a text element. |