▸ Agent Skills
3 min read

Clipboard

GitHubnpmcrates.io

API Reference:

Read and write to the system clipboard using the clipboard plugin.

Supported Platforms

This plugin requires a Rust version of at least 1.77.2

[TABLE]

Setup

Install the clipboard plugin to get started.

Use your project’s package manager to add the dependency:

npm run tauri add clipboard-manager
yarn run tauri add clipboard-manager
pnpm tauri add clipboard-manager
deno task tauri add clipboard-manager
bun tauri add clipboard-manager
cargo tauri add clipboard-manager
  1. Run the following command in the src-tauri folder to add the plugin to the project’s dependencies in Cargo.toml:

    cargo add tauri-plugin-clipboard-manager
  2. Modify lib.rs to initialize the plugin:

    #[cfg_attr(mobile, tauri::mobile_entry_point)]pub fn run() {    tauri::Builder::default()        .plugin(tauri_plugin_clipboard_manager::init())        .run(tauri::generate_context!())        .expect("error while running tauri application");}

    src-tauri/src/lib.rs

  3. If you’d like to manage the clipboard in JavaScript then install the npm package as well:

    npm install @tauri-apps/plugin-clipboard-manager
    yarn add @tauri-apps/plugin-clipboard-manager
    pnpm add @tauri-apps/plugin-clipboard-manager
    deno add npm:@tauri-apps/plugin-clipboard-manager
    bun add @tauri-apps/plugin-clipboard-manager

Usage

The clipboard plugin is available in both JavaScript and Rust.

import { writeText, readText } from '@tauri-apps/plugin-clipboard-manager';// when using `"withGlobalTauri": true`, you may use// const { writeText, readText } = window.__TAURI__.clipboardManager;
// Write content to clipboardawait writeText('Tauri is awesome!');
// Read content from clipboardconst content = await readText();console.log(content);// Prints "Tauri is awesome!" to the console
use tauri_plugin_clipboard_manager::ClipboardExt;
app.clipboard().write_text("Tauri is awesome!".to_string()).unwrap();
// Read content from clipboardlet content = app.clipboard().read_text();println!("{:?}", content.unwrap());// Prints "Tauri is awesome!" to the terminal

Default Permission

No features are enabled by default, as we believe the clipboard can be inherently dangerous and it is application specific if read and/or write access is needed.

Clipboard interaction needs to be explicitly enabled.

Permission Table

IdentifierDescription
clipboard-manager:allow-clearEnables the clear command without any pre-configured scope.
clipboard-manager:deny-clearDenies the clear command without any pre-configured scope.
clipboard-manager:allow-read-imageEnables the read_image command without any pre-configured scope.
clipboard-manager:deny-read-imageDenies the read_image command without any pre-configured scope.
clipboard-manager:allow-read-textEnables the read_text command without any pre-configured scope.
clipboard-manager:deny-read-textDenies the read_text command without any pre-configured scope.
clipboard-manager:allow-write-htmlEnables the write_html command without any pre-configured scope.
clipboard-manager:deny-write-htmlDenies the write_html command without any pre-configured scope.
clipboard-manager:allow-write-imageEnables the write_image command without any pre-configured scope.
clipboard-manager:deny-write-imageDenies the write_image command without any pre-configured scope.
clipboard-manager:allow-write-textEnables the write_text command without any pre-configured scope.
clipboard-manager:deny-write-textDenies the write_text command without any pre-configured scope.

Support on Open CollectiveSponsor on GitHub

© 2026 Tauri Contributors. CC-BY / MIT


Last updated Oct 08, 2026