A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://Tarektouati.github.io/vue-use-web/functions/clipboard.html below:

Website Navigation


Clipboard | useWeb

# Clipboard

The Clipboard API provides the ability to respond to clipboard commands (cut, copy, and paste) as well as to asynchronously read from and write to the system clipboard. Access to the contents of the clipboard is gated behind the Permissions API; without user permission, reading or altering the clipboard contents is not permitted.

Note!

This API is designed to supersede accessing the clipboard using document.execCommand().

# State

The useClipboard function exposes the following reactive state:

State Type Description text string the current text in the clipboard. # Methods

The useClipboard function exposes the following methods:

Signature Description write(str: string) Writes the given string it in the clipboard. # Use-cases

I'm sure you can think of multiple situations where you would like to copy the clipboard text or write some data into them. Mainly stuff like copying code in snippets, referral links, recovery codes or really any hard to remember text.

# Example

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4