Skip to main content
Version: v2

Clipboard

The Clipboard API enables copy and pasting to/from the clipboard. On iOS this API also allows copying images and URLs.

Example

import { Plugins } from '@capacitor/core';

const { Clipboard } = Plugins;

Clipboard.write({
string: 'Hello, Moto',
});

let result = await Clipboard.read();
console.log('Got', result.type, 'from clipboard:', result.value);

API

write(...)

write(options: ClipboardWrite) => Promise<void>

Write a value to the clipboard (the "copy" action)

ParamType
optionsClipboardWrite

read()

read() => Promise<ClipboardReadResult>

Read a value from the clipboard (the "paste" action)

Returns: Promise<ClipboardReadResult>


Interfaces

ClipboardWrite

PropType
stringstring
imagestring
urlstring
labelstring

ClipboardReadResult

PropType
valuestring
typestring