UI & Dom
useClipboard
useClipboard copies values in components
- Import
- import { useClipboard } from '@kubed/hooks;'
- Source
- View source code
- Docs
- Edit this page
- npm
- @kubed/hooks
Usage
useClipboard copies the value in the component.
API
1function useClipboard(2{timeout}?: {timeout?: number}3): {copy: (valueToCopy: any) => void, reset: () => void, error: Error, copied: boolean}
Params
Parameters | Default Value | Type | Description |
---|---|---|---|
timeout | 2000 | number | The time delay for event triggering |
Result
Parameters | Default Value | Type | Description |
---|---|---|---|
copy | - | (valueToCopy: any) => void | The value to be copied |
reset | - | () => void | Reset the copied value |
error | - | Error | An error when copying a value |
copied | - | boolean | Whether the copied value was successful |