useClipboard returns a stable controller with support detection, operation status, latest text, and error state.
Signature
ClipboardController useClipboard();
Lifecycle
final clipboard = useClipboard();
await clipboard.writeText('Copied from Jaspr');
Overlapping operations use latest-operation-wins state updates. Completed Futures still return their own result.
Server rendering
The controller is deterministic with isSupported == false and status == idle; mutations reject until browser activation.
Common mistakes
Clipboard access usually requires HTTPS, permission, and a user gesture. Always handle rejected Futures and provide visible feedback.
Related APIs
Use useAsyncAction for richer async workflows and useEvent for stable gesture handlers.