Clipboard gives you an interface for setting to the clipboard. (Getting clipboard content is not currently supported on web.)

import { Clipboard } from 'react-native';


Static methods #

isAvailable () => boolean

Determines whether the browser environment supports Clipboard at all.

setString () => boolean

Copies a string to the clipboard. On web, some browsers may not support copying to the clipboard, therefore, this function returns a boolean to indicate if the copy was successful.

getString () => Promise<"">

Not properly supported on Web. Returns a Promise of an empty string.

Examples #

React Native for WebCopyright © Nicolas Gallagher and Meta Platforms, Inc.