Skip to content

copyToClipboard

Copies the given value to the clipboard using the Navigator API. If it does not exist, it falls back to using a textarea element as a workaround.

Usage

await copyToClipboard("Hello, world!");

Installation

Terminal window
npx atmx add helper copy-to-clipboard