{"id":18488398,"url":"https://github.com/react-component/image","last_synced_at":"2026-04-01T23:48:15.573Z","repository":{"id":33916869,"uuid":"163581296","full_name":"react-component/image","owner":"react-component","description":"🖼 React Image Component","archived":false,"fork":false,"pushed_at":"2026-03-23T10:00:32.000Z","size":36225,"stargazers_count":211,"open_issues_count":49,"forks_count":118,"subscribers_count":4,"default_branch":"master","last_synced_at":"2026-03-30T01:39:56.869Z","etag":null,"topics":["ant-design","antd","react","react-component"],"latest_commit_sha":null,"homepage":"https://image-sepia.vercel.app","language":"TypeScript","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/react-component.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"ant-design","patreon":null,"open_collective":"ant-design","ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"lfx_crowdfunding":null,"polar":null,"buy_me_a_coffee":null,"thanks_dev":null,"custom":null}},"created_at":"2018-12-30T11:09:11.000Z","updated_at":"2026-03-25T04:20:15.000Z","dependencies_parsed_at":"2023-01-15T03:20:10.135Z","dependency_job_id":"d208752c-2b6d-4648-b276-8b2d04fa48fb","html_url":"https://github.com/react-component/image","commit_stats":{"total_commits":277,"total_committers":44,"mean_commits":6.295454545454546,"dds":0.8050541516245487,"last_synced_commit":"20afe8dcac73256f24e794e74bc8cbb3a3a2831d"},"previous_names":[],"tags_count":117,"template":false,"template_full_name":null,"purl":"pkg:github/react-component/image","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/react-component%2Fimage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/react-component%2Fimage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/react-component%2Fimage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/react-component%2Fimage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/react-component","download_url":"https://codeload.github.com/react-component/image/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/react-component%2Fimage/sbom","scorecard":{"id":765364,"data":{"date":"2025-08-11","repo":{"name":"github.com/react-component/image","commit":"872e7290905bdc061b62aa30909e69726f4c3b7b"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.9,"checks":[{"name":"Maintained","score":2,"reason":"3 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":3,"reason":"Found 10/30 approved changesets -- score normalized to 3","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/react-component-ci.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: third-party GitHubAction not pinned by hash: .github/workflows/react-component-ci.yml:5: update your workflow using https://app.stepsecurity.io/secureworkflow/react-component/image/react-component-ci.yml/master?enable=pin","Info:   0 out of   1 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.md:0","Info: FSF or OSI recognized license: MIT License: LICENSE.md:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 15 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-23T00:37:24.983Z","repository_id":33916869,"created_at":"2025-08-23T00:37:24.983Z","updated_at":"2025-08-23T00:37:24.983Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31224990,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-31T07:25:37.180Z","status":"ssl_error","status_checked_at":"2026-03-31T07:24:10.811Z","response_time":111,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["ant-design","antd","react","react-component"],"created_at":"2024-11-06T12:51:41.197Z","updated_at":"2026-04-01T23:48:15.565Z","avatar_url":"https://github.com/react-component.png","language":"TypeScript","funding_links":["https://github.com/sponsors/ant-design","https://opencollective.com/ant-design"],"categories":["TypeScript"],"sub_categories":[],"readme":"# rc-image\n\nReact Image.\n\n\u003c!-- prettier-ignore --\u003e\n[![NPM version][npm-image]][npm-url]\n[![npm download][download-image]][download-url]\n[![build status][github-actions-image]][github-actions-url]\n[![Codecov][codecov-image]][codecov-url]\n[![bundle size][bundlephobia-image]][bundlephobia-url]\n[![dumi][dumi-image]][dumi-url]\n\n[npm-image]: http://img.shields.io/npm/v/rc-image.svg?style=flat-square\n[npm-url]: http://npmjs.org/package/rc-image\n[github-actions-image]: https://github.com/react-component/image/actions/workflows/react-component-ci.yml/badge.svg\n[github-actions-url]: https://github.com/react-component/image/actions/workflows/react-component-ci.yml\n[codecov-image]: https://img.shields.io/codecov/c/gh/react-component/image?style=flat-square\n[codecov-url]: https://codecov.io/gh/react-component/image\n[download-image]: https://img.shields.io/npm/dm/rc-image.svg?style=flat-square\n[download-url]: https://npmjs.org/package/rc-image\n[bundlephobia-url]: https://bundlephobia.com/result?p=rc-image\n[bundlephobia-image]: https://badgen.net/bundlephobia/minzip/rc-image\n[dumi-url]: https://github.com/umijs/dumi\n[dumi-image]: https://img.shields.io/badge/docs%20by-dumi-blue?style=flat-square\n\n## Feature\n\n- [x] Placeholder\n- [x] Preview\n- [x] Rotate\n- [x] Zoom\n- [x] Flip\n- [x] Fallback\n- [x] Multiple Preview\n\n## install\n\n[![rc-image](https://nodei.co/npm/rc-image.png)](https://npmjs.org/package/rc-image)\n\n## Usage\n\n```bash\nnpm install\nnpm start\n```\n\n```js\nimport Image from '@rc-component/image';\n\nexport default () =\u003e (\n  \u003cImage src=\"https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png\" /\u003e\n);\n```\n\n## API\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| preview | boolean \\| [PreviewType](#PreviewType) | true | Whether to show preview |\n| prefixCls | string | rc-image | Classname prefix |\n| placeholder | boolean \\| ReactElement | - | if `true` will set default placeholder or use `ReactElement` set customize placeholder |\n| fallback | string | - | Load failed src |\n| previewPrefixCls | string | rc-image-preview | Preview classname prefix |\n| onError | (event: Event) =\u003e void | - | Load failed callback |\n\n### PreviewType\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| open | boolean | - | Whether the preview is open or not |\n| closeIcon | React.ReactNode | - | Custom close icon |\n| src | string | - | Customize preview src |\n| movable | boolean | true | Enable drag |\n| scaleStep | number | 0.5 | The number to which the scale is increased or decreased |\n| minScale | number | 1 | Min scale |\n| maxScale | number | 50 | Max scale |\n| forceRender | boolean | - | Force render preview |\n| getContainer | string \\| HTMLElement \\| (() =\u003e HTMLElement) \\| false | document.body | Return the mount node for preview |\n| imageRender | (originalNode: React.ReactElement, info: { transform: [TransformType](#TransformType) }) =\u003e React.ReactNode | - | Customize image |\n| actionsRender | (originalNode: React.ReactElement, info: Omit\u003c[ToolbarRenderInfoType](#ToolbarRenderInfoType), 'current' \\| 'total'\u003e) =\u003e React.ReactNode | - | Customize toolbar |\n| onOpenChange | (open: boolean, prevVisible: boolean) =\u003e void | - | Callback when open is changed |\n| onTransform | { transform: [TransformType](#TransformType), action: [TransformAction](#TransformAction) } | - | Callback when transform is changed |\n\n## Image.PreviewGroup\n\npreview the merged src\n\n```js\nimport Image from '@rc-component/image';\n\nexport default () =\u003e (\n  \u003cImage.PreviewGroup\u003e\n    \u003cImage src=\"https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png\" /\u003e\n    \u003cImage src=\"https://gw.alipayobjects.com/mdn/rms_08e378/afts/img/A*P0S-QIRUbsUAAAAAAAAAAABkARQnAQ\" /\u003e\n  \u003c/Image.PreviewGroup\u003e\n);\n```\n\n### API\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| preview | boolean \\| [PreviewGroupType](#PreviewGroupType) | true | Whether to show preview, \u003cbr\u003e current: If Preview the show img index, default 0 |\n| previewPrefixCls | string | rc-image-preview | Preview classname prefix |\n| icons | { [iconKey]?: ReactNode } | - | Icons in the top operation bar, iconKey: 'rotateLeft' \\| 'rotateRight' \\| 'zoomIn' \\| 'zoomOut' \\| 'close' \\| 'left' \\| 'right' |\n| fallback | string | - | Load failed src |\n| items | (string \\| { src: string, alt: string, crossOrigin: string, ... })[] | - | preview group |\n\n### PreviewGroupType\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| open | boolean | - | Whether the preview is open or not |\n| movable | boolean | true | Enable drag |\n| current | number | - | Current index |\n| closeIcon | React.ReactNode | - | Custom close icon |\n| scaleStep | number | 0.5 | The number to which the scale is increased or decreased |\n| minScale | number | 1 | Min scale |\n| maxScale | number | 50 | Max scale |\n| forceRender | boolean | - | Force render preview |\n| getContainer | string \\| HTMLElement \\| (() =\u003e HTMLElement) \\| false | document.body | Return the mount node for preview |\n| countRender | (current: number, total: number) =\u003e ReactNode | - | Customize count |\n| imageRender | (originalNode: React.ReactElement, info: { transform: [TransformType](#TransformType), current: number }) =\u003e React.ReactNode | - | Customize image |\n| actionsRender | (originalNode: React.ReactElement, info: [ToolbarRenderInfoType](#ToolbarRenderInfoType)) =\u003e React.ReactNode | - | Customize toolbar |\n| onOpenChange | (open: boolean, prevVisible: boolean, current: number) =\u003e void | - | Callback when open is changed |\n| onTransform | { transform: [TransformType](#TransformType), action: [TransformAction](#TransformAction) } | - | Callback when transform is changed |\n\n### TransformType\n\n```typescript\n{\n  x: number;\n  y: number;\n  rotate: number;\n  scale: number;\n  flipX: boolean;\n  flipY: boolean;\n}\n```\n\n### TransformAction\n\n```typescript\ntype TransformAction =\n  | 'flipY'\n  | 'flipX'\n  | 'rotateLeft'\n  | 'rotateRight'\n  | 'zoomIn'\n  | 'zoomOut'\n  | 'close'\n  | 'prev'\n  | 'next'\n  | 'wheel'\n  | 'doubleClick'\n  | 'move'\n  | 'dragRebound';\n```\n\n### ToolbarRenderInfoType\n\n```typescript\n{\n  icons: {\n    prevIcon?: React.ReactNode;\n    nextIcon?: React.ReactNode;\n    flipYIcon: React.ReactNode;\n    flipXIcon: React.ReactNode;\n    rotateLeftIcon: React.ReactNode;\n    rotateRightIcon: React.ReactNode;\n    zoomOutIcon: React.ReactNode;\n    zoomInIcon: React.ReactNode;\n  };\n  actions: {\n    onActive?: (offset: number) =\u003e void;\n    onFlipY: () =\u003e void;\n    onFlipX: () =\u003e void;\n    onRotateLeft: () =\u003e void;\n    onRotateRight: () =\u003e void;\n    onZoomOut: () =\u003e void;\n    onZoomIn: () =\u003e void;\n    onClose: () =\u003e void;\n    onReset: () =\u003e void;\n  };\n  transform: {\n    x: number;\n    y: number;\n    rotate: number;\n    scale: number;\n    flipX: boolean;\n    flipY: boolean;\n  },\n  current: number;\n  total: number;\n}\n```\n\n## Example\n\nhttp://localhost:8003/examples/\n\n## Test Case\n\n```\nnpm test\n```\n\n## Coverage\n\n```\nnpm run coverage\n```\n\n## License\n\nrc-image is released under the MIT license.\n\n## 🤝 Contributing \n\n\u003ca href=\"https://openomy.app/github/react-component/image\" target=\"_blank\" style=\"display: block; width: 100%;\" align=\"center\"\u003e\n  \u003cimg src=\"https://www.openomy.app/svg?repo=react-component/image\u0026chart=bubble\u0026latestMonth=24\" target=\"_blank\" alt=\"Contribution Leaderboard\" style=\"display: block; width: 100%;\" /\u003e\n\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freact-component%2Fimage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freact-component%2Fimage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freact-component%2Fimage/lists"}