{"id":16123966,"url":"https://github.com/evenchange4/react-progressive-bg-image","last_synced_at":"2025-05-16T05:04:05.889Z","repository":{"id":48501250,"uuid":"89999693","full_name":"evenchange4/react-progressive-bg-image","owner":"evenchange4","description":"🖼  Medium style progressive background image.","archived":false,"fork":false,"pushed_at":"2024-12-08T18:18:36.000Z","size":34896,"stargazers_count":227,"open_issues_count":25,"forks_count":15,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-06T07:50:46.871Z","etag":null,"topics":["progressive-image","react","styled-components"],"latest_commit_sha":null,"homepage":"https://react-progressive-bg-image.netlify.com/","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/evenchange4.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"zenodo":null}},"created_at":"2017-05-02T06:34:50.000Z","updated_at":"2024-09-24T22:08:42.000Z","dependencies_parsed_at":"2023-10-25T18:45:49.213Z","dependency_job_id":"d53db0bc-a22c-478b-a83e-78d7fdb998fa","html_url":"https://github.com/evenchange4/react-progressive-bg-image","commit_stats":{"total_commits":91,"total_committers":3,"mean_commits":"30.333333333333332","dds":"0.15384615384615385","last_synced_commit":"aa84006da9c3c52a7e413eccc43f2d18bfcdfdbb"},"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evenchange4%2Freact-progressive-bg-image","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evenchange4%2Freact-progressive-bg-image/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evenchange4%2Freact-progressive-bg-image/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evenchange4%2Freact-progressive-bg-image/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/evenchange4","download_url":"https://codeload.github.com/evenchange4/react-progressive-bg-image/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254471062,"owners_count":22076585,"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":["progressive-image","react","styled-components"],"created_at":"2024-10-09T21:19:19.610Z","updated_at":"2025-05-16T05:04:05.809Z","avatar_url":"https://github.com/evenchange4.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-progressive-bg-image\n\n\u003e Medium style progressive background image for React based on [Styled-components](https://github.com/styled-components/styled-components).\n\n[![Travis][build-badge]][build]\n[![Codecov Status][codecov-badge]][codecov]\n[![npm package][npm-badge]][npm]\n[![npm downloads][npm-downloads]][npm]\n\n[![Dependency Status][dependency-badge]][dependency]\n[![devDependency Status][devdependency-badge]][devdependency]\n[![peerDependency Status][peerdependency-badge]][peerdependency]\n\n[![prettier][prettier-badge]][prettier]\n[![license][license-badge]][license]\n\n## Demo\n\n* https://react-progressive-bg-image.netlify.com/\n* Responsive example: https://michaelhsu.tw/ [[Source code]](https://github.com/evenchange4/michaelhsu.tw/blob/master/src/components/CoverImage.js#L37-L44)\n* Img tag example: https://mcslite.netlify.com/ [[Source code]](https://github.com/MCS-Lite/mcs-lite/blob/master/packages/mcs-lite-landing-web/src/components/BackgroundImage/BackgroundImage.js)\n\n![DEMO](./docs/demo.gif)\n\n## Further Reading:\n\n* [[English] Reproducing Medium Style Progressive Image Loading for React](https://medium.com/@evenchange4/reproducing-medium-style-progressive-image-loading-for-react-2e83bba0c608).\n* [[中文] React Stack 開發體驗與優化策略](https://medium.com/@evenchange4/react-stack-%E9%96%8B%E7%99%BC%E9%AB%94%E9%A9%97%E8%88%87%E5%84%AA%E5%8C%96%E7%AD%96%E7%95%A5-b056da2fa0aa)\n\n## Installation\n\n```sh\n$ yarn add react-progressive-bg-image styled-components\n```\n\n## Requirements\n\n* node \u003e= 9.4.0\n* yarn \u003e= 1.3.2\n\n* react `^16.0.0`,\n* styled-components `^3`\n\n## Usage\n\n### Case 1: Inline-style\n\n\u003e Remind: May need to setup autoprefixer in your project.\n\n```js\nimport ProgressiveImage from 'react-progressive-bg-image';\n\n\u003cProgressiveImage\n  src={image1}\n  placeholder={image1X60}\n  style={{\n    height: 600,\n    backgroundSize: 'contain',\n    backgroundPosition: 'center center',\n  }}\n/\u003e;\n```\n\n### Case 2: With Styled-components\n\n```js\nimport styled from 'styled-components';\nimport ProgressiveImage from 'react-progressive-bg-image';\n\nconst StyledProgressiveImage = styled(ProgressiveImage)`\n  height: 600px;\n  background-size: contain;\n  background-position: center center;\n`;\n\n\u003cStyledProgressiveImage\n  src={IMAGE}\n  placeholder={IMAGEX60}\n  transition=\"all 1s linear\"\n/\u003e;\n```\n\n## Property\n\n| **Prop**      | **Type** | **Required** | **Description**                     |\n| ------------- | -------- | ------------ | ----------------------------------- |\n| `src`         | string   | yes          | Origin image                        |\n| `placeholder` | string   | yes          | Small image (Suggest inline base64) |\n| `opacity`     | number   |              | default: 0.5                        |\n| `blur`        | number   |              | default: 20                         |\n| `scale`       | number   |              | default: 1                          |\n| `transition`  | string   |              | default: 'opacity 0.3s linear'      |\n| `component`   | string   |              | default: 'div'                      |\n\n## Test\n\n```\n$ yarn run format\n$ yarn run eslint\n$ yarn run test:watch\n```\n\n## Github release / NPM release\n\n```\n$ npm version patch\n$ git push\n```\n\n---\n\n## Inspiration\n\n* https://github.com/FormidableLabs/react-progressive-image\n* [How Medium does progressive image loading](https://jmperezperez.com/medium-image-progressive-loading-placeholder/)\n\n## CONTRIBUTING\n\n* ⇄ Pull requests and ★ Stars are always welcome.\n* For bugs and feature requests, please create an issue.\n* Pull requests must be accompanied by passing automated tests (`$ yarn run test`).\n\n## [CHANGELOG](CHANGELOG.md)\n\n## [LICENSE](LICENSE)\n\nMIT: [http://michaelhsu.mit-license.org](http://michaelhsu.mit-license.org)\n\n[build-badge]: https://img.shields.io/travis/evenchange4/react-progressive-bg-image/master.svg?style=flat-square\n[build]: https://travis-ci.org/evenchange4/react-progressive-bg-image\n[npm-badge]: https://img.shields.io/npm/v/react-progressive-bg-image.svg?style=flat-square\n[npm]: https://www.npmjs.org/package/react-progressive-bg-image\n[codecov-badge]: https://img.shields.io/codecov/c/github/evenchange4/react-progressive-bg-image.svg?style=flat-square\n[codecov]: https://codecov.io/github/evenchange4/react-progressive-bg-image?branch=master\n[npm-downloads]: https://img.shields.io/npm/dt/react-progressive-bg-image.svg?style=flat-square\n[license-badge]: https://img.shields.io/npm/l/react-progressive-bg-image.svg?style=flat-square\n[license]: http://michaelhsu.mit-license.org/\n[dependency-badge]: https://david-dm.org/evenchange4/react-progressive-bg-image.svg?style=flat-square\n[dependency]: https://david-dm.org/evenchange4/react-progressive-bg-image\n[devdependency-badge]: https://david-dm.org/evenchange4/react-progressive-bg-image/dev-status.svg?style=flat-square\n[devdependency]: https://david-dm.org/evenchange4/react-progressive-bg-image#info=devDependencies\n[peerdependency-badge]: https://david-dm.org/evenchange4/react-progressive-bg-image/peer-status.svg?style=flat-square\n[peerdependency]: https://david-dm.org/evenchange4/react-progressive-bg-image#info=peerDependencies\n[prettier-badge]: https://img.shields.io/badge/styled_with-prettier-ff69b4.svg?style=flat-square\n[prettier]: https://github.com/prettier/prettier\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevenchange4%2Freact-progressive-bg-image","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fevenchange4%2Freact-progressive-bg-image","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevenchange4%2Freact-progressive-bg-image/lists"}