Skip to main content

Interface: UseClipboardOptions

Defined in: use-clipboard.ts:6

Options for useClipboard.

Properties​

onCopy?​

optional onCopy?: (text) => void

Defined in: use-clipboard.ts:14

Called with the copied text after a successful copy.

Parameters​

text​

string

Returns​

void


onError?​

optional onError?: (error) => void

Defined in: use-clipboard.ts:16

Called with the error when a copy fails.

Parameters​

error​

Error

Returns​

void


timeout?​

optional timeout?: number | null

Defined in: use-clipboard.ts:12

How long, in milliseconds, copied stays true after a successful copy. Pass null to keep it true until reset is called or the next copy. Default is 2000.