[](https://badge.fury.io/js/vue-lazy)

[](https://github.com/bartdominiak/vue-lazy/blob/master/LICENSE.md)
# vue-lazy
> Lightweight Image/Picture lazyload based on Intersection API.
## About
Please note that this lib is on very early stage.
## Storybook
- 📕 [Example](https://vue-lazy.surge.sh)
- 📺 [Props/Events/Slots](https://vue-lazy.surge.sh/?path=/docs/image--default)
## Benefits
- Lightweight
- Picture tag support
## Installation & Usage
### `Vue@3` version
Will be added soon
### `Vue@2` version
#### Installation
```terminal
yarn add vue-lazy // or npm install vue-lazy
```
#### Usage - Globally
```js
import Vue from 'vue'
import VueLazy from 'vue-lazy'
import 'vue-lazy/dist/vue-lazy.css'
Vue.use(VueLazy)
```
#### Usage - Locally
```js
import { LazyImage } from 'vue-lazy'
import 'vue-lazy/dist/vue-lazy.css'
export default {
components: { LazyImage }
}
```
### Example usage
If you want to see live examples, please jump to Storybook page.
### Image
```html
```
### Image with known width (prevent jumping content on page)
```html
```
### Picture
```html
```
## Development
Install necessary depandancies with yarn or npm
```
yarn // or npm install
```
Run Storybook for development mode
```
yarn storybook:dev
```
Release
```
yarn release
```
## Contribution
If you have a feature request then feel free to start a new issue, or just grab existing one.
## License
MIT