Clipboard
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
Platform | Level | Notes |
---|---|---|
windows | ||
linux | ||
macos | ||
android | | Only plain-text content support |
ios | | Only plain-text content support |
Setup
Install the clipboard plugin to get started.
Use your project’s package manager to add the dependency:
-
Run the following command in the
src-tauri
folder to add the plugin to the project’s dependencies inCargo.toml
: -
Modify
lib.rs
to initialize the plugin: -
If you’d like to manage the clipboard in JavaScript then install the npm package as well:
Usage
The clipboard plugin is available in both JavaScript and Rust.
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
Identifier | Description |
---|---|
|
Enables the clear command without any pre-configured scope. |
|
Denies the clear command without any pre-configured scope. |
|
Enables the read_image command without any pre-configured scope. |
|
Denies the read_image command without any pre-configured scope. |
|
Enables the read_text command without any pre-configured scope. |
|
Denies the read_text command without any pre-configured scope. |
|
Enables the write_html command without any pre-configured scope. |
|
Denies the write_html command without any pre-configured scope. |
|
Enables the write_image command without any pre-configured scope. |
|
Denies the write_image command without any pre-configured scope. |
|
Enables the write_text command without any pre-configured scope. |
|
Denies the write_text command without any pre-configured scope. |
© 2024 Tauri Contributors. CC-BY / MIT