JGuang

Skeleton

Skeleton · Arco Design

Preview
npm install @arco-design/web-react@2.66.18

Skeleton

Use gray blocks to occupy the loading data.

Install

npm install @arco-design/web-react@2.66.18

Import @arco-design/web-react/dist/css/arco.css at the entry and set the locale with ConfigProvider. React 19 projects must also import @arco-design/web-react/es/_util/react-19-adapter first, or imperative APIs such as Message and Modal cannot render.

Examples

  • Basic: Basic usage of skeleton screen.
  • Use in Paragraph: Set the number of text lines and text width.
  • Animation: Display animation effects.

Examples come from the official Arco Design repository (MIT) at the commit published as npm 2.66.18. Some use online images or upload endpoints; network requests are disabled in previews.

API

Skeleton

PropertyDescriptionTypeDefaultValue
animationWhether to show animationboolean-
loadingWhether to show subcomponents. Set true to show placeholderbooleantrue
classNameAdditional css classstring | string[]-
imageWhether to show the picture placeholderSkeletonImageProps | boolean-
styleAdditional styleCSSProperties-
textWhether to show text placeholderSkeletonTextProps | booleantrue

SkeletonImageProps

export interface SkeletonImageProps {
  style?: CSSProperties;
  className?: string;
  /** 图片形状 */
  shape?: "circle" | "square";
  /** 图片尺寸 */
  size?: "small" | "default" | "large";
  /** 图片位置 */
  position?: "left" | "right";
  prefixCls?: string;
}

SkeletonTextProps

export interface SkeletonTextProps {
  style?: CSSProperties;
  className?: string;
  /** 文本行数 */
  rows?: number;
  /** 文本行宽度 */
  width?: number | string | (string | number)[];
  prefixCls?: string;
}