Click to copy

Hi all, I’m trying to integrate a click to copy function into my readymag project. I have colour chips and I want to be able to copy the HEX code when I click on the colour chip, like in this example here, any tips or tricks on how to make this happen would be appreciated!