Skip to main content
c5inco
Dec 19, 2021 11:53 PM UTC
Question

Write to Clipboard from custom plugin

Considering that document.execCommand is deprecated, what would the best way to write to the system clipboard within a custom plugin?

Right now, it’s a bit hacky where one can create a temporary HTML UI, set elements like textarea with the intended value to copy, then use document.execCommand. That will likely not be supported in the future, so ideally there’d be a nice and secure way to work with the system clipboard through a Figma API.

This topic has been closed for replies.

23 replies

Wes Byrne
New Member
May 21, 2025 5:39 PM UTC

Anyone have any updates here? I don’t seem to have access to the clipboard API and execCommand doesn't seem to be doing anything… 

JimB
New Member
Sep 3, 2025 12:47 PM UTC

execCommand(“copy”) works for us, but i think it has size limitations. And the only error/feedback you get from it is a boolean, so thats not great for the user experience.

Bogriceanu_Sorin
New Participant
Oct 2, 2025 8:48 AM UTC

a working Clipboard api would be nice to have as we move more and more towards AI and text based tools