@zeushq/design-system
Version:
12 lines (11 loc) • 325 B
TypeScript
/**
* React hook to copy content to clipboard
*
* @param text the text or value to copy
* @param timeout delay (in ms) to switch back to initial state once copied.
*/
export declare function useClipboard(text: string, timeout?: number): {
value: string;
onCopy: () => void;
hasCopied: boolean;
};