Actions

copyText

Puts text on the clipboard: through the Clipboard API, or a text selection where the page may not use it (plain http, an older browser). Resolves whether it worked; never throws.

import { copyText } from "@/lib/ouro/share";

Example

if (await copyText(url)) toast("Link copied");

Parameters

text
Type: string

Returns

Promise<boolean>