Gathering detailed insights and metrics for @uiw/react-copy-to-clipboard
Gathering detailed insights and metrics for @uiw/react-copy-to-clipboard
npm install @uiw/react-copy-to-clipboard
Typescript
Module System
Node Version
NPM Version
63.6
Supply Chain
92.8
Quality
78.3
Maintenance
100
Vulnerability
100
License
TypeScript (78.99%)
Less (20.49%)
JavaScript (0.38%)
HTML (0.12%)
Shell (0.01%)
Love this project? Help keep it running — sponsor us today! 🚀
Total Downloads
81,740
Last Day
29
Last Week
119
Last Month
1,152
Last Year
15,871
MIT License
722 Stars
3,301 Commits
121 Forks
31 Watchers
15 Branches
25 Contributors
Updated on Feb 12, 2025
Minified
Minified + Gzipped
Latest Version
4.22.3
Package Id
@uiw/react-copy-to-clipboard@4.22.3
Unpacked Size
9.75 kB
Size
3.06 kB
File Count
12
NPM Version
9.8.1
Node Version
18.18.2
Published on
Nov 29, 2023
Cumulative downloads
Total Downloads
Last Day
-14.7%
29
Compared to previous day
Last Week
-47.3%
119
Compared to previous week
Last Month
0%
1,152
Compared to previous month
Last Year
-21%
15,871
Compared to previous year
2
将文本到剪切板,复制到剪贴板功能可以应用于各种元素,基于 @uiwjs/copy-to-clipboard 封装。
1import { CopyToClipboard } from 'uiw'; 2// or 3import CopyToClipboard from '@uiw/react-copy-to-clipboard';
1import React from 'react'; 2import { CopyToClipboard } from 'uiw'; 3 4class Demo extends React.Component { 5 constructor() { 6 super(); 7 this.state = { 8 message: '' 9 } 10 } 11 render() { 12 return ( 13 <div> 14 <CopyToClipboard 15 text="我被一个连接复制了!" 16 onClick={() => { 17 this.setState({ message: '复制成功!你可以粘贴了。' }, () => { 18 setTimeout(() => { 19 this.setState({ message: '' }); 20 }, 2000); 21 }); 22 }} 23 > 24 点击我复制 25 </CopyToClipboard> 26 <div style={{color: '#28a745'}}>{this.state.message}</div> 27 </div> 28 ) 29 } 30} 31export default Demo;
1import React from 'react'; 2import { CopyToClipboard, Input, Button } from 'uiw'; 3 4class Demo extends React.Component { 5 constructor(props){ 6 super(props); 7 this.state = { 8 copyText: "生亦何欢,死亦何苦" 9 }; 10 this.input = React.createRef(); 11 } 12 onChange(e){ 13 // this.setState({ 14 // copyText: e.target.value 15 // }) 16 } 17 render() { 18 const { copyText } = this.state; 19 return ( 20 <div> 21 <div> 22 <Input 23 type="text" 24 ref={this.input} 25 value={copyText} 26 onChange={this.onChange.bind(this)} 27 /> 28 </div> 29 <CopyToClipboard 30 style={{ marginTop:10, display:'inline-block' }} 31 text={copyText} 32 onClick={() => { 33 // 复制提示 34 this.setState({ message: '复制成功!你可以粘贴了。' }, () => { 35 setTimeout(() => { 36 this.setState({ message: '' }); 37 }, 2000); 38 }); 39 this.input.current.select(); 40 }} 41 > 42 <Button type="primary">点击复制</Button> 43 <span style={{color: '#28a745'}}>{this.state.message}</span> 44 </CopyToClipboard> 45 </div> 46 ) 47 } 48} 49export default Demo;
参数 | 说明 | 类型 | 默认值 |
---|---|---|---|
text | 拷贝的文本 | String | - |
onClick | 点击事件 | Function(text,isCopy,event) | - |
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
0 existing vulnerabilities detected
Reason
packaging workflow detected
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 1/26 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
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-02-03
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