useClipboard
Copies text to the clipboard with a short-lived copied flag and an optional toast. Falls back to a hidden textarea where navigator.clipboard is missing (plain http, some WebViews).
Install: pnpm add-composable useClipboard
Copy with toast
Copy a value and automatically display a global success toast.
API
copy((text: string, showToast?: boolean) => Promise<boolean>): Copies text. Resolves false when neither the Clipboard API nor the fallback worked.copied(Ref<boolean>): True for resetAfter ms after a successful copy. Its timer stops with the component.isSupported(boolean): The Clipboard API or the textarea fallback is available.resetAfter(number): Option. How long copied stays true, in ms.toastMessage(string): Option. The toast text for copy(text, true).