Skip to content

albseb511/dyno-img-react

Repository files navigation

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 root. The hq image will get loaded at the margin
        rootMargin={"10%"}
      />
    )
  }
}

License

MIT © albseb511

Releases

No releases published

Packages

No packages published