1.0.8 • Published 2 years ago

safe-gatsby-image-plugin v1.0.8

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Fail-safe wrapper around Gatsby-Image component


How it works

  • If the transformed localFile cannot be found, the original image is used.
  • If the passed image is null|undefined, a placeholder image will be used.

Setup

1. Install

npm i safe-gatsby-image-plugin

2. Usage example

 import { Image } from 'safe-gatsby-image-plugin';

 // Example of of what a typical image object returned by Gatsby looks like
 const imageDataObj = {
   localFile: {
     alt_text,
     source_url,
     childImageSharp: {
       fluid: {
         ...
       }
     }
   }
 }
 <Image data={imageDataObj} className='image-class' style={{marginTop: 10}} />
1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago