dyno-img-react

1.0.101 • Public • Published

dyno-img-react

a versatile react img component set low quality image set high quality image lazy loading

NPM JavaScript Style Guide

Install

npm install --save dyno-img-react

Usage

import React, { Component } from 'react'
 
import DynoImg from 'dyno-img-react'
 
class Example extends Component {
  render () {
    return (
      <DynoImg 
        src={"low-quality-img-url"}
        srcHigh={"high-quality-img-url"}
        alt={"alternate"}
        // rootMargin defines the Margin around the rootThe hq image will get loaded at the margin
        rootMargin={"10%"}
      />
    )
  }
}

License

MIT © albseb511

Package Sidebar

Install

npm i dyno-img-react

Weekly Downloads

3

Version

1.0.101

License

MIT

Unpacked Size

15.1 kB

Total Files

6

Last publish

Collaborators

  • albseb511