Copy as application/json

How can I implement custom code to copy data as application/json? Like when I build my own component library webflow wants the clipboard data as application/json. How can I impklement that code?

Thanks :slight_smile:

JS. There are some good examples here in the forum, and a few video tutorials as I recall.
You may need to do some digging through search results but there is some gold in there.