Skeleton

Provide a placeholder while you wait for content to load, or to visualize content that doesn't exist yet.
Importimport{ Skeleton }from"antd";

When To Use

  • When a resource needs long time to load.
  • When the component contains lots of information, such as List or Card.
  • Only works when loading data for the first time.
  • Could be replaced by Spin in any situation, but can provide a better user experience.

Examples

Simplest Skeleton usage.

codepen icon
External Link Icon
expand codeexpand code

Complex combination with avatar and multiple paragraphs.

codepen icon
External Link Icon
expand codeexpand code

Display active animation.

codepen icon
External Link Icon
expand codeexpand code






Image placeholder

Skeleton Button, Avatar, Input, Image and Node.

codepen icon
External Link Icon
expand codeexpand code

Ant Design, a design language

We supply a series of design principles, practical patterns and high quality design resources (Sketch and Axure), to help people create their product prototypes beautifully and efficiently.

Skeleton contains sub component.

codepen icon
External Link Icon
expand codeexpand code

Use skeleton in list component.

codepen icon
External Link Icon
expand codeexpand code

API

Common props ref:Common props

Skeleton

PropertyDescriptionTypeDefault
activeShow animation effectbooleanfalse
avatarShow avatar placeholderboolean | SkeletonAvatarPropsfalse
loadingDisplay the skeleton when trueboolean-
paragraphShow paragraph placeholderboolean | SkeletonParagraphPropstrue
roundShow paragraph and title radius when truebooleanfalse
titleShow title placeholderboolean | SkeletonTitlePropstrue

SkeletonAvatarProps

PropertyDescriptionTypeDefault
activeShow animation effect, only valid when used avatar independentlybooleanfalse
shapeSet the shape of avatarcircle | square-
sizeSet the size of avatarnumber | large | small | default-

SkeletonTitleProps

PropertyDescriptionTypeDefault
widthSet the width of titlenumber | string-

SkeletonParagraphProps

PropertyDescriptionTypeDefault
rowsSet the row count of paragraphnumber-
widthSet the width of paragraph. When width is an Array, it can set the width of each row. Otherwise only set the last row widthnumber | string | Array<number | string>-

SkeletonButtonProps

PropertyDescriptionTypeDefaultVersion
activeShow animation effectbooleanfalse
blockOption to fit button width to its parent widthbooleanfalse4.17.0
shapeSet the shape of buttoncircle | round | square | default-
sizeSet the size of buttonlarge | small | default-

SkeletonInputProps

PropertyDescriptionTypeDefault
activeShow animation effectbooleanfalse
sizeSet the size of inputlarge | small | default-

Design Token

Global TokenHow to use?