Gathering detailed insights and metrics for rc-image
Gathering detailed insights and metrics for rc-image
Gathering detailed insights and metrics for rc-image
Gathering detailed insights and metrics for rc-image
npm install rc-image
Typescript
Module System
Node Version
NPM Version
92.6
Supply Chain
94.4
Quality
83.8
Maintenance
100
Vulnerability
100
License
v7.12.0
Updated on Apr 22, 2025
@rc-component/image@1.4.0
Updated on Apr 22, 2025
@rc-component/image@1.3.0
Updated on Apr 08, 2025
@rc-component/image@1.2.5
Updated on Mar 18, 2025
@rc-component/image@1.2.4
Updated on Mar 18, 2025
@rc-component/image@1.2.3
Updated on Mar 18, 2025
TypeScript (89.29%)
Less (9.59%)
JavaScript (1.12%)
Total Downloads
194,615,871
Last Day
70,855
Last Week
1,533,168
Last Month
6,547,270
Last Year
67,761,801
MIT License
206 Stars
305 Commits
106 Forks
5 Watchers
15 Branches
56 Contributors
Updated on Jun 26, 2025
Minified
Minified + Gzipped
Latest Version
7.12.0
Package Id
rc-image@7.12.0
Unpacked Size
155.11 kB
Size
24.62 kB
File Count
72
NPM Version
10.8.2
Node Version
22.5.1
Published on
Apr 22, 2025
Cumulative downloads
Total Downloads
Last Day
3.1%
70,855
Compared to previous day
Last Week
-12.7%
1,533,168
Compared to previous week
Last Month
1.4%
6,547,270
Compared to previous month
Last Year
31.5%
67,761,801
Compared to previous year
React Image.
1npm install 2npm start
1import Image from 'rc-image'; 2 3export default () => ( 4 <Image src="https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png" /> 5);
Name | Type | Default | Description |
---|---|---|---|
preview | boolean | PreviewType | true | Whether to show preview |
prefixCls | string | rc-image | Classname prefix |
placeholder | boolean | ReactElement | - | if true will set default placeholder or use ReactElement set customize placeholder |
fallback | string | - | Load failed src |
previewPrefixCls | string | rc-image-preview | Preview classname prefix |
onError | (event: Event) => void | - | Load failed callback |
Name | Type | Default | Description |
---|---|---|---|
visible | boolean | - | Whether the preview is open or not |
closeIcon | React.ReactNode | - | Custom close icon |
src | string | - | Customize preview src |
movable | boolean | true | Enable drag |
scaleStep | number | 0.5 | The number to which the scale is increased or decreased |
minScale | number | 1 | Min scale |
maxScale | number | 50 | Max scale |
forceRender | boolean | - | Force render preview |
getContainer | string | HTMLElement | (() => HTMLElement) | false | document.body | Return the mount node for preview |
imageRender | (originalNode: React.ReactElement, info: { transform: TransformType }) => React.ReactNode | - | Customize image |
toolbarRender | (originalNode: React.ReactElement, info: Omit<ToolbarRenderInfoType, 'current' | 'total'>) => React.ReactNode | - | Customize toolbar |
onVisibleChange | (visible: boolean, prevVisible: boolean) => void | - | Callback when visible is changed |
onTransform | { transform: TransformType, action: TransformAction } | - | Callback when transform is changed |
preview the merged src
1import Image from 'rc-image'; 2 3export default () => ( 4 <Image.PreviewGroup> 5 <Image src="https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png" /> 6 <Image src="https://gw.alipayobjects.com/mdn/rms_08e378/afts/img/A*P0S-QIRUbsUAAAAAAAAAAABkARQnAQ" /> 7 </Image.PreviewGroup> 8);
Name | Type | Default | Description |
---|---|---|---|
preview | boolean | PreviewGroupType | true | Whether to show preview, current: If Preview the show img index, default 0 |
previewPrefixCls | string | rc-image-preview | Preview classname prefix |
icons | { [iconKey]?: ReactNode } | - | Icons in the top operation bar, iconKey: 'rotateLeft' | 'rotateRight' | 'zoomIn' | 'zoomOut' | 'close' | 'left' | 'right' |
fallback | string | - | Load failed src |
items | (string | { src: string, alt: string, crossOrigin: string, ... })[] | - | preview group |
Name | Type | Default | Description |
---|---|---|---|
visible | boolean | - | Whether the preview is open or not |
movable | boolean | true | Enable drag |
current | number | - | Current index |
closeIcon | React.ReactNode | - | Custom close icon |
scaleStep | number | 0.5 | The number to which the scale is increased or decreased |
minScale | number | 1 | Min scale |
maxScale | number | 50 | Max scale |
forceRender | boolean | - | Force render preview |
getContainer | string | HTMLElement | (() => HTMLElement) | false | document.body | Return the mount node for preview |
countRender | (current: number, total: number) => ReactNode | - | Customize count |
imageRender | (originalNode: React.ReactElement, info: { transform: TransformType, current: number }) => React.ReactNode | - | Customize image |
toolbarRender | (originalNode: React.ReactElement, info: ToolbarRenderInfoType) => React.ReactNode | - | Customize toolbar |
onVisibleChange | (visible: boolean, prevVisible: boolean, current: number) => void | - | Callback when visible is changed |
onTransform | { transform: TransformType, action: TransformAction } | - | Callback when transform is changed |
1{ 2 x: number; 3 y: number; 4 rotate: number; 5 scale: number; 6 flipX: boolean; 7 flipY: boolean; 8}
1type TransformAction = 2 | 'flipY' 3 | 'flipX' 4 | 'rotateLeft' 5 | 'rotateRight' 6 | 'zoomIn' 7 | 'zoomOut' 8 | 'close' 9 | 'prev' 10 | 'next' 11 | 'wheel' 12 | 'doubleClick' 13 | 'move' 14 | 'dragRebound';
1{ 2 icons: { 3 prevIcon?: React.ReactNode; 4 nextIcon?: React.ReactNode; 5 flipYIcon: React.ReactNode; 6 flipXIcon: React.ReactNode; 7 rotateLeftIcon: React.ReactNode; 8 rotateRightIcon: React.ReactNode; 9 zoomOutIcon: React.ReactNode; 10 zoomInIcon: React.ReactNode; 11 }; 12 actions: { 13 onActive?: (offset: number) => void; 14 onFlipY: () => void; 15 onFlipX: () => void; 16 onRotateLeft: () => void; 17 onRotateRight: () => void; 18 onZoomOut: () => void; 19 onZoomIn: () => void; 20 onClose: () => void; 21 onReset: () => void; 22 }; 23 transform: { 24 x: number; 25 y: number; 26 rotate: number; 27 scale: number; 28 flipX: boolean; 29 flipY: boolean; 30 }, 31 current: number; 32 total: number; 33}
http://localhost:8003/examples/
npm test
npm run coverage
rc-image is released under the MIT license.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
5 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 4
Reason
Found 10/30 approved changesets -- score normalized to 3
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
security policy file not detected
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-06-23
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More