useClipboard
Copy text to clipboard
Usage
'use client' import { useClipboard } from '@/hooks/use-clipboard' const App = () => { const { isCopied, onCopy } = useClipboard('Hello, world!') return ( <button type="button" onClick={onCopy}> {isCopied ? 'Copied' : 'Copy'} </button> ) }