Clipboard

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

import { Clipboard } from 'react-native';

API

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

  For TV Examples: LRUD navigation is already enabled in this sandbox. Use your keyboard arrow keys to move focus.

Updated
React Native Web for TVPortions Copyright © Nicolas Gallagher, Meta Platforms, Inc., Facebook, Inc. and affiliates, and other contributors as noted in file headers and THIRD_PARTY_NOTICES.md. Modifications and TV extensions Copyright © Harpreet Singh and contributors.