React Image (Suspense-like) Loader component that simulates a shimmer effect
npm install react-shimmer

> A powerful, customisable, Suspense-like component that (optionally) simulates a shimmer effect while __loading__. (with zero dependencies!).


``bash`
npm i react-shimmer
or
`bash`
yarn add react-shimmer
`jsx
import React from 'react'
import { Image, Shimmer } from 'react-shimmer'
function App() {
return (
`jsx
import React from 'react'
import { Image, Breathing } from 'react-shimmer'function App() {
return (
src='https://source.unsplash.com/random/800x600'
fallback={ }
/>
)
}
`or you can use your custom React component as a fallback:
`jsx
import React from 'react'
import { Image } from 'react-shimmer'import Spinner from './Spinner'
function App(props) {
return (
src="https://example.com/test.jpg"
fallback={ }
/>
)
}
`$3
Property | Type | Required | Default value | Description
:--- | :--- | :--- | :--- | :---
src|string|yes||
fallback|ReactNode|yes||
errorFallback|func|no||
onLoad|func|no||
delay|number|no|| Delay in milliseconds before showing the fallback
fadeIn|bool|no|false|Use built-in fade animation on img
NativeImgProps`|React.ImgHTMLAttributesFeel free to send PRs.
MIT © gokcan