Copy to Clipboard button

Hi,

I’m trying to figure out how I can make a copy to clipboard button to use with code snippets. Similar to ones in coding tutorials.

Any ideas would be much appreciated.