@snivio/react-image-loader
TypeScript icon, indicating that this package has built-in type declarations

0.0.5 • Public • Published

React Image Loader

This Component Makes lazy loading images a breeze with both loading element and error element by taking care of loading and error handling within the element

Usage of Component

  • Props
Props Description
loader Loading element
error error element
children react child element
import { ImageLoader } from "./components";

function App() {
  const src = "https://placehold.co/600x400";
  return (
    <>
      <ImageLoader loader={"Loading"} src={src} error={"Error has occurred"}>
        <img src={src} />
      </ImageLoader>
    </>
  );
}

export default App;

Package Sidebar

Install

npm i @snivio/react-image-loader

Weekly Downloads

2

Version

0.0.5

License

ISC

Unpacked Size

173 kB

Total Files

12

Last publish

Collaborators

  • snivio