A handy placeholder component to show the user when content is loading
If you use npm:
npm i --save react-content-placeholder
If you use yarn:
yarn add react-content-placeholder
This package has been tested with React 15 and 16. It should work on every browser that react works.
We display the content placeholder to indicate the user that the content is being loaded/generated.
You can use the built-in components to design your placeholder however you wish. For now we have 3 components, but this list might extend by time.
Here is an example usage:
import ContentPlaceholder from 'react-content-placeholder'
<ContentPlaceholder>
<ContentPlaceholder.Card align="vertical" />
<ContentPlaceholder.ImageText align="horizontal" />
<ContentPlaceholder.paragraph numberOfLines={2} />
<ContentPlaceholder.paragraph numberOfLines={5} />
</ContentPlaceholder>
Wrapper component. All subcomponents should be placed within this component.
Displays a card style placeholder with an image and text.
Property | Description | Values | Default |
---|---|---|---|
align | Aligns the card either horizontally or vertically. | {String}: horizontal | vertical. |
numberOfLines | Specifies the number of lines the embedded paragraph should have. | {Number} | 6 if horizontal, 2 otherwise. |
Displays an image with a text.
Property | Description | Values | Default |
---|---|---|---|
align | Aligns the card either horizontally or vertically. | {String}: horizontal | vertical. |
numberOfLines | Specifies the number of lines the embedded paragraph should have. | {Number} | 2 |
Displays a paragraph.
Property | Description | Values | Default |
---|---|---|---|
numberOfLines | Specifies the number of lines in the paragraph. | {Number} | 3 |
All assets and code are under the GPL-3.0 and in the public domain unless specified otherwise.