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)
Param | Type |
---|---|
options |
|
read()
read() => Promise<ClipboardReadResult>
Read a value from the clipboard (the "paste" action)
Returns:
Promise<ClipboardReadResult>
Interfaces
ClipboardWrite
Prop | Type |
---|---|
string | string |
image | string |
url | string |
label | string |
ClipboardReadResult
Prop | Type |
---|---|
value | string |
type | string |