Skip to content
Tauri

writeHtml

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

Defined in: index.ts:126

  • Writes HTML or fallbacks to write provided plain text to the clipboard.
  • Android / iOS: Not supported.

string

string

Promise<void>

A promise indicating the success or failure of the operation.

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>');

2.0.0


© 2025 Tauri Contributors. CC-BY / MIT