{"id":15685596,"url":"https://github.com/evavic44/react-lazyload","last_synced_at":"2025-05-07T17:20:38.332Z","repository":{"id":54379400,"uuid":"522063877","full_name":"Evavic44/react-lazyload","owner":"Evavic44","description":"🦥 A tutorial to illustrate how to lazyload images in a react app using react lazy load image component library","archived":false,"fork":false,"pushed_at":"2023-06-06T15:17:16.000Z","size":322,"stargazers_count":10,"open_issues_count":1,"forks_count":3,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-31T12:11:35.278Z","etag":null,"topics":["asset-optimization","images","lazyload","lazyload-image","react","react-lazyload","reactjs"],"latest_commit_sha":null,"homepage":"https://react-lazyload.vercel.app","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Evavic44.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-08-06T22:09:31.000Z","updated_at":"2023-12-11T05:38:52.000Z","dependencies_parsed_at":"2024-10-23T19:26:21.673Z","dependency_job_id":"1a32130f-d422-40c1-9fd5-172f68770390","html_url":"https://github.com/Evavic44/react-lazyload","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Evavic44%2Freact-lazyload","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Evavic44%2Freact-lazyload/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Evavic44%2Freact-lazyload/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Evavic44%2Freact-lazyload/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Evavic44","download_url":"https://codeload.github.com/Evavic44/react-lazyload/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252922308,"owners_count":21825641,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["asset-optimization","images","lazyload","lazyload-image","react","react-lazyload","reactjs"],"created_at":"2024-10-03T17:27:25.951Z","updated_at":"2025-05-07T17:20:38.288Z","avatar_url":"https://github.com/Evavic44.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# React Lazyload Images\n\nThis tutorial is meant to showcase how to lazyload images in a react application using the NPM library: [React Lazy Load Image Component](https://www.npmjs.com/package/react-lazy-load-image-component)\n\n### Default\n\nDefault image in react without the lazyload effect\n[Source](https://react-lazyload-image.netlify.app/default)\n\n```js\nimport Image from \"../images/bird.jpg\";\n\u003cimg className=\"image\" src={Image} width={800} height={550} alt=\"Fishy\" /\u003e;\n```\n\n### Placeholder\n\nThis illustrates the lazyload image component with a placeholder image.\nTo test this, visit the [/placeholder](https://react-lazyload-image.netlify.app/default) page, set throttling in developer tools to Good 2G, and refresh the page to see the effect.\n\nAdding a placeholder image is very simple, simply add `placeholderSrc=\"\"` attribute with your placeholder image within the quotes to the `LazyLoadImage` component.\n\n```js\nimport { LazyLoadImage } from \"react-lazy-load-image-component\";\nimport Image from \"../images/bird.jpg\";\nimport PlaceholderImage from \"../images/placeholder.jpg\";\n\n\u003cLazyLoadImage\n  src={Image}\n  width={800}\n  height={500}\n  placeholderSrc={PlaceholderImage}\n  alt=\"bird\"\n/\u003e;\n```\n\n### Blur\n\nThis illustrates the lazyload image component with a placeholder image and a blur effeect.\nTo test this, visit the [/blur](https://react-lazyload-image.netlify.app/default) p\n\nCombining the placeholder image and blur effect provides the best experience for users. To enable it, add the placeholder image and add and effect set to `blur`.\n\nYou can add effects like:\n\n- blur: renders a blurred image based on placeholderSrc and transitions to a non-blurred one when the image specified in the src is loaded.\n- black-and-white: renders a black and white image based on placeholderSrc and transitions to a colorful image when the image specified in the src is loaded.\n- opacity: renders a blank space and transitions to full opacity when the image is loaded.\n\n\u003e Note: They effects rely on CSS and the corresponding CSS file must be imported:\n\n```js\nimport { LazyLoadImage } from \"react-lazy-load-image-component\";\nimport Image from \"../images/bird.jpg\";\nimport PlaceholderImage from \"../images/placeholder.jpg\";\n\n\u003cLazyLoadImage\n  src={Image}\n  width={800}\n  height={530}\n  placeholderSrc={PlaceholderImage}\n  effect=\"blur\"\n  alt=\"image\"\n/\u003e;\n```\n\nTutorial prepared by [Victor Eke](https://github.com/evavic44)\n\n## Resources\n\n- [Demo URL](https://react-lazyload-image.netlify.app/)\n- [React Lazy Load Image Component - NPM](https://www.npmjs.com/package/react-lazy-load-image-component)\n- [React Lazy Load Image Component - GitHub](https://github.com/Aljullu/react-lazy-load-image-component)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevavic44%2Freact-lazyload","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fevavic44%2Freact-lazyload","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevavic44%2Freact-lazyload/lists"}