Ioniconf 2022 logo

Uniting our global community of Ionic developers and contributors. May 25, 2022.

DocsPluginsCLI
pwaiosandroid

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 ClipboardWrite

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
Previous
<- Camera
Next
Console ->
Contribute ->