Ember addon for rendering fake content while data is fetching to provide better UX and lower bounce rate.
ember install ember-content-placeholders
{{#content-placeholders as |placeholder|}}
{{placeholder.heading img=true}}
{{placeholder.text lines=3}}
{{/content-placeholders}}
{{#content-placeholders rounded=true as |placeholder|}}
{{placeholder.img}}
{{placeholder.heading}}
{{/content-placeholders}}
root content-placeholders
animated
(default: true)rounded
(default: false) - border radiuscentered
(default: false)
properties from root component are automatically passed down to each one of yielded components, so they can be overriden whenever necessary per comoponent case
yield placeholder.heading
img
(default: false)yield placeholder.text
lines
(default: 4)yield placeholder.img
yield placeholder.nav
TO DO:
placeholder.list
placeholder.chart
placeholder.table
Composable components make it easy to form a required module, but sometimes it's not enough. If you'd like to also amend styling, there are few variables that can help you out:
$ember-content-placeholders-primary-color
- heading background$ember-content-placeholders-secondary-color
- light background$ember-content-placeholders-border-radius
- border radius size when rounded
property is true
$ember-content-placeholders-line-height
- single line height$ember-content-placeholders-spacing
- distance between linesgit clone https://github.com/{YOUR_USERNAME}/ember-content-placeholders
cd ember-content-placeholders
yarn install
yarn lint:js
yarn lint:js --fix
ember test
– Runs the test suite on the current Ember versionember test --server
– Runs the test suite in "watch mode"yarn test
– Runs ember try:each
to test your addon against multiple Ember versionsember serve
For more information on using ember-cli, visit https://ember-cli.com/.
This project is licensed under the MIT License.