vue-content-loader
SVG component to create placeholder loading, like Facebook cards loading.
Features
This is a Vue port for react-content-loader.
- Completely customizable: you can change the colors, speed and sizes.
- Create your own loading: use the online tool to create your custom loader easily.
- You can use it right now: there are a lot of presets already.
- Performance:
- Tree-shakable and highly optimized bundle.
- Pure SVG, so it's works without any javascript, canvas, etc.
- Pure functional components.
Install
Usage
?? Demos: Storybook | with Nuxt.js
Built-in loaders
ContentLoader
is a meta loader while other loaders are just higher-order components of it. By default ContentLoader
only displays a simple rectangle, here's how you can use it to create custom loaders:
API
Props
Prop | Type | Default | Description |
---|---|---|---|
width | number | 400 |
|
height | number | 130 |
|
speed | number | 2 |
|
preserveAspectRatio | string | 'xMidYMid meet' |
|
primaryColor | string | '#f9f9f9' |
|
secondaryColor | string | '#ecebeb' |
|
uniqueKey | string | randomId() |
Unique ID, you need to make it consistent for SSR |
animate | boolean | true |