UNPKG

@supunlakmal/hooks

Version:

A collection of reusable React hooks

17 lines (16 loc) 694 B
type UseClipboardWithFeedbackReturn = [ string | null, (text: string) => Promise<boolean>, boolean ]; /** * A hook that extends useClipboard to provide feedback when text is copied. * * @param {number} feedbackDuration Duration in milliseconds to show the feedback state (default: 2000ms). * @returns A tuple containing: * - The current clipboard text ('value' from useClipboard). * - The function to copy text to the clipboard (returns boolean success). * - A boolean indicating if text was recently copied (for feedback). */ export declare function useClipboardWithFeedback(feedbackDuration?: number): UseClipboardWithFeedbackReturn; export {};