{"repo":"mbrevda/react-image","free":true,"listed":false,"github":"https://github.com/mbrevda/react-image","clone":"git clone https://github.com/mbrevda/react-image.git","description":"React.js <img> tag rendering with multiple fallback & loader support","language":"TypeScript","stars":1232,"topics":["react","reactjs","image","fallback","preloader","preload","loader","react-img-multi"],"license":"MIT","category":"media-processing","readme_excerpt":"React Image 🏝 🏖 🏜 React Image is an tag replacement and hook for React.js, supporting fallback to alternate sources when loading an image fails. React Image allows one or more images to be used as fallback images in the event that the browser couldn't load the previous image. When using the component, you can specify any React element to be used before an image is loaded (i.e. a spinner) or in the event that the specified image(s) could not be loaded. When using the hook this can be achieved by wrapping the component with and specifying the fallback prop. React Image uses the useImage hook internally which encapsulates all the image loading logic. This hook works with React Suspense by default and will suspend painting until the image is downloaded and decoded by the browser. Getting started 1. To include the code locally in ES6, CommonJS, or UMD format, install react-image using npm: 2. To include the code globally from a cdn: Dependencies react-image has no external dependencies, aside from a version of react and react-dom which support hooks and @babel/runtime . Documentation You can use the standalone component, documented below, or the useImage hook. useImage(): The useImage hook allows for incorporating react-image 's logic in any component. When using the hook, the component can be wrapped in to keep it from rendering until the image is ready. Specify the fallback prop to show a spinner or any other component to the user while the browser is loading. The hook will t","default_branch":null,"files":null,"tree":[],"storefront":"/r/mbrevda","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/mbrevda/react-image/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}