useCopyToClipboard
A hook that copies text to the clipboard.
Installation
Install the following dependencies
Loading...
API Reference
Input Params
| Param | Type | Default | Description |
|---|---|---|---|
timeout | number | undefined | 2000 | The timeout in milliseconds to reset the copied state. If undefined, the copied state will not be reset. |
onCopy | () => void | undefined | - | The callback function to be called when the text is copied to the clipboard. |
Returned Props
| Prop | Type | Default | Description |
|---|---|---|---|
isCopied | boolean | false | Indicates if the text has been copied to the clipboard. |
copyToClipboard | (value: string) => void | - | Copies the given text to the clipboard. |