ember-content-placeholders
ember-content-placeholders copied to clipboard
Composable components for rendering fake (progressive) content like facebook
ember-content-placeholders
Ember addon for rendering fake content while data is fetching to provide better UX and lower bounce rate.
:cd: Installation
ember install ember-content-placeholders
:rocket: Usage
{{#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}}

Available components and properties
-
root
content-placeholders- Boolean
animated(default: true) - Boolean
rounded(default: false) - border radius - Boolean
centered(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
- Boolean
-
yield
placeholder.heading- Boolean
img(default: false)
- Boolean
-
yield
placeholder.text- Number
lines(default: 4)
- Number
-
yield
placeholder.img -
yield
placeholder.nav
TO DO:
placeholder.listplaceholder.chartplaceholder.table
Customization
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 whenroundedproperty istrue$ember-content-placeholders-line-height- single line height$ember-content-placeholders-spacing- distance between lines
:beers: Contributing
Installation
- Fork this repo
git clone https://github.com/{YOUR_USERNAME}/ember-content-placeholderscd ember-content-placeholdersyarn install
Linting
yarn lint:jsyarn lint:js --fix
Running tests
ember test– Runs the test suite on the current Ember versionember test --server– Runs the test suite in "watch mode"yarn test– Runsember try:eachto test your addon against multiple Ember versions
Running the dummy application
ember serve- Visit the dummy application at http://localhost:4200.
For more information on using ember-cli, visit https://ember-cli.com/.
:lock: License
This project is licensed under the MIT License.