Gathering detailed insights and metrics for use-clipboard-hook
Gathering detailed insights and metrics for use-clipboard-hook
Gathering detailed insights and metrics for use-clipboard-hook
Gathering detailed insights and metrics for use-clipboard-hook
npm install use-clipboard-hook
Typescript
Module System
Min. Node Version
Node Version
NPM Version
78
Supply Chain
95.2
Quality
74.8
Maintenance
100
Vulnerability
100
License
TypeScript (47.3%)
JavaScript (33.76%)
CSS (14.65%)
HTML (4.28%)
Love this project? Help keep it running — sponsor us today! 🚀
Total Downloads
77,021
Last Day
20
Last Week
752
Last Month
2,484
Last Year
23,926
MIT License
6 Stars
20 Commits
2 Branches
1 Contributors
Updated on Jan 21, 2021
Minified
Minified + Gzipped
Latest Version
1.1.1
Package Id
use-clipboard-hook@1.1.1
Size
339.29 kB
NPM Version
6.13.7
Node Version
12.13.0
Published on
Jul 14, 2020
Cumulative downloads
Total Downloads
Last Day
900%
20
Compared to previous day
Last Week
39.5%
752
Compared to previous week
Last Month
86.8%
2,484
Compared to previous month
Last Year
11.4%
23,926
Compared to previous year
1
1
18
Copy/Cut to clipboard React hook.
Using npm:
1npm install --save use-clipboard-hook
Using yarn:
1yarn add use-clipboard-hook
1import * as React from "react"; 2 3import { useClipboard } from "use-clipboard-hook"; 4 5const Example = () => { 6 const {ref, copy, cut} = useClipboard({ 7 onSuccess: (text) => alert(`Copied: ${text}`), 8 }); 9 return ( 10 <div> 11 <input ref={ref} defaultValue="Change this..." /> 12 <button onClick={copy}>copy</button> 13 <button onClick={cut}>cut</button> 14 </div> 15 ); 16};
useClipboard(options: UseClipboardProps): useClipboardReturnType
UseClipboardProps
onSuccess
- It's a callback function that is called after the copy
or cut
command is executed.onError
- Triggers when the hook encounters an error. If passed hook won't throw an error.disableClipboardAPI
- Disables the new clipboard API navigator.clipboard
even if it is supported.copiedDuration
- Revert back the isCopied flag to false again if a value is set.useClipboardReturnType
ref
- Use ref to pull the text content from.copy
- Used to perform the copy operation.cut
- Used to perform the cut operation.isCoppied
- Indicates wheater the content was successfully copied or not.clipboard
- Current selected clipboard content.clearClipboard
- Clears the user clipboard.isSupported
- Check to see if the browser supports the new navigator.clipboard
API.toggle-selection - sudodoki
If you found this project useful, then please consider giving it a ⭐️ on Github and sharing it with your friends via social media.
If you have any suggestion for including a feature or if something doesn't work, feel free to open a Github issue for us to have a discussion on it.
MIT © fayeed
This hook is created using create-react-hook.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
no SAST tool detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/20 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
97 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-02-10
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