React based Skeleton animation component with full customisable themes.
with npm
npm install --save @riyazurrazak/react-skeleton
with yarn
yarn add @riyazurrazak/react-skeleton
CodeSandBox : Demo
import React from 'react'
import {SkeletonWrapper} from '@riyazurrazak/react-skeleton'
export const Example = ()=>{
return(
<SkeletonWrapper isLoading={true}>
{/** inner content */}
<p>Async content</p>
</SkeletonWrapper>
)
}
Property | Type | Default | Description |
---|---|---|---|
isLoading | bool | false | Set true to loading effect. Set false to render elements inside the SkeletonWrapper |
className | string | null | Custom class to make the skeleton to style as you want |
width | string | 'auto' | width of your skeleton |
height | string | 'auto' | height of your skeleton |
circle | bool | false | make skeleton as circle. Note: width and height must be eqaul |
wave | bool | false | make skeleton as wave animation |
backgroundColor | string | rgba(0, 0, 0, 0.11) | background of the skeleton |
highlightColor | string | rgba(0, 0, 0, 0.04) | highlightedcolor of the skeleton. Will be effect if wave property is true |
MIT © RiyazurRazak