1.0.3 • Published 2 years ago

react-skeleton-state v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

React Skeleton

npm version

Show a loading skeleton of your content animated before your content arrived from e.g. API or lazy loading

Example

Installation

npm install --save react-skeleton-state
yarn add react-skeleton-state

Usage

import ReactSkeleton from "react-skeleton-state";

<ReactSkeleton width={200} fontSize={"1rem"} variant="text"></ReactSkeleton>
<ReactSkeleton width={50} height={50} variant="circle"></ReactSkeleton>
<ReactSkeleton width={200} fontSize={"1rem"} variant="text"></ReactSkeleton>
<ReactSkeleton width={200} height={200} variant="rectangle"></ReactSkeleton>

Props

PropTypeDefaultDescription
widthnumber4The width of the skeleton PX
heightnumber4The height of your skeleton PX
variantstring"rectangle"Either "rectangle", "circle" or "text"
fontSizestringnullfontSize if variant is text
borderRadiusnumber4Border radius of the skeleton PX
backgroundColorStartstring"#efefef"Start color state for animation
backgroundColorEndstring"#e4e4e4"End color state for animation
childrenreactNodenullInclude any react children
1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago