React Skeleton

React Skeleton

·

1 min read

React Skeleton is a placeholder to display instead of the actual content.

Setup

Refer to PrimeReact setup documentation for download and installation steps for your environment.

Import

import { Skeleton } from 'primereact/skeleton';

Getting Started

Skeleton displays a rectangle in its simplest form.

<Skeleton />

Circle

The other option is the circle by setting shape property as "circle".

<Skeleton shape="circle" />

Size

In order to customize the size, use width and height properties for rectangles and size for Circle and Square shapes.

<Skeleton width="100%" height="2rem" />
<Skeleton shape="circle" size="50px" />

Border Radius

The default border radius of a rectangle is specified by the theme and can be overriden using the borderRadius property.

<Skeleton borderRadius="16px" />

Animation

Animation can be turned of by setting animation to "none".

<Skeleton animation="none" />

Theming

Skeleton supports various themes featuring Material, Bootstrap, Fluent as well as your own custom themes via the Designer tool.

Resources

Visit the PrimeReact Skeleton showcase for demos and documentation.