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
TypeScript (47.3%)
JavaScript (33.76%)
CSS (14.65%)
HTML (4.28%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
6 Stars
20 Commits
2 Branches
1 Contributors
Updated on Jan 21, 2021
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
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
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
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 SAST tool detected
Details
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
102 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
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