Feedback · Skeleton
Skeleton
A placeholder preview of content before the data loaded.
Overview
Avatar
: Avatar placeholder, by default uses Avatar medium sizing:width: 48px
,height: 48px
. Supports Avatar's size and shape attributes (after v2.20)Image
: Image placeholder, default size:width: 100%
,height: 100%
.Title
: Title placeholder, default size:width: 100%
,height: 24px
.Paragraph
: Content part placeholder, default size:width: 100%
,height: 16px
,margin-bottom: 10px
.Button
: Button placeholder, default size:width: 115px
,height: 32px
.
Note: Default styles could by overwritten throughclassName
orstyle
.
Demos
How to import
Basic Usage
Combinations
Image and caption.
Statistics.
Avatar and title.
Centered paragraphs and button.
Avatar, headline and paragraph.
Table.
Animated Loading
Use
active
property to display animated loading effects.API reference
Skeleton
Property | Instructions | type | Default |
---|---|---|---|
active | Toggle whether to show the animated loading effect | boolean | false |
class Name | Class name | string | - |
loading | When set to true, the placeholder element is displayed. Otherwise, child element is displayed | boolean | true |
placeholder | Elements to be displayed while loading | ReactNode | - |
style | Inline style | CSSProperties | - |
Skeleton.Avatar
Skeleton.Image
,Skeleton.Title
,Skeleton.Button
have same APIs withSkeleton.Avatar
.shape
only supported inSkeleton.Avatar
Property | Instructions | type | Default |
---|---|---|---|
class Name | Class name | string | - |
size | Size of the avatar, one of extra-extra-small , extra-small , small , medium , large , extra-large | string | medium |
style | Inline style | CSSProperties | - |
shape | Shape of the avatar, one of circle , square | string | circle |
Skeleton.Paragraph
Property | Instructions | type | Default |
---|---|---|---|
className | Class name | string | - |
rows | Set the number of rows in the placeholder paragraph | number | 4 |
style | Inline style | CSSProperties | - |
Content Guidelines
- Unchanged fixed content directly displays fixed content, and variable content is displayed using skeleton screen