Skip to content

@tauri-apps/plugin-clipboard-manager

Read and write to the system clipboard.

function clear(): Promise<void>;

Defined in: plugins/clipboard-manager/guest-js/index.ts:147

Clears the clipboard.

Platform-specific

  • Android: Only supported on SDK 28+. For older releases we write an empty string to the clipboard instead.
import { clear } from '@tauri-apps/plugin-clipboard-manager';
await clear();

Promise<void>

2.0.0


function readImage(): Promise<Image>;

Defined in: plugins/clipboard-manager/guest-js/index.ts:99

Gets the clipboard content as Uint8Array image.

Platform-specific

  • Android / iOS: Not supported.
import { readImage } from '@tauri-apps/plugin-clipboard-manager';
const clipboardImage = await readImage();
const blob = new Blob([await clipboardImage.rgba()], { type: 'image' })
const url = URL.createObjectURL(blob)

Promise<Image>

2.0.0


function readText(): Promise<string>;

Defined in: plugins/clipboard-manager/guest-js/index.ts:46

Gets the clipboard content as plain text.

import { readText } from '@tauri-apps/plugin-clipboard-manager';
const clipboardText = await readText();

Promise<string>

2.0.0


function writeHtml(html: string, altText?: string): Promise<void>;

Defined in: plugins/clipboard-manager/guest-js/index.ts:126

  • Writes HTML or fallbacks to write provided plain text to the clipboard.

Platform-specific

  • Android / iOS: Not supported.
import { writeHtml } from '@tauri-apps/plugin-clipboard-manager';
await writeHtml('<h1>Tauri is awesome!</h1>', 'plaintext');
// The following will write "<h1>Tauri is awesome</h1>" as plain text
await writeHtml('<h1>Tauri is awesome!</h1>', '<h1>Tauri is awesome</h1>');
// we can read html data only as a string so there's just readText(), no readHtml()
assert(await readText(), '<h1>Tauri is awesome!</h1>');
Parameter Type
html string
altText? string

Promise<void>

A promise indicating the success or failure of the operation.

2.0.0


function writeImage(image: string | Image | Uint8Array | ArrayBuffer | number[]): Promise<void>;

Defined in: plugins/clipboard-manager/guest-js/index.ts:74

Writes image buffer to the clipboard.

Platform-specific

  • Android / iOS: Not supported.
import { writeImage } from '@tauri-apps/plugin-clipboard-manager';
const buffer = [
// A red pixel
255, 0, 0, 255,
// A green pixel
0, 255, 0, 255,
];
await writeImage(buffer);
Parameter Type
image | string | Image | Uint8Array | ArrayBuffer | number[]

Promise<void>

A promise indicating the success or failure of the operation.

2.0.0


function writeText(text: string, opts?: {
label?: string;
}): Promise<void>;

Defined in: plugins/clipboard-manager/guest-js/index.ts:27

Writes plain text to the clipboard.

import { writeText, readText } from '@tauri-apps/plugin-clipboard-manager';
await writeText('Tauri is awesome!');
assert(await readText(), 'Tauri is awesome!');
Parameter Type
text string
opts? { label?: string; }
opts.label? string

Promise<void>

A promise indicating the success or failure of the operation.

2.0.0


© 2026 Tauri Contributors. CC-BY / MIT