Gallery

Copy helpers

copyText() answers whether the text reached the clipboard; selectContents() selects it for copying by hand. Ours (trackable-cmp).

Install

npx shadcn@4.23.0 add https://ui.dobrin-dobrev.co.uk/r/copy-text.json

Into an app set up with shadcn init --base radix; the parts it uses come with it.

Files

  • registry/default/lib/copy-text.ts