Created
November 29, 2025 16:40
-
-
Save InnaTarasyan/91191ec41c337e5e9384257d48deadda to your computer and use it in GitHub Desktop.
Blade Component for Client-Side Copy Button
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- resources/views/components/copy.blade.php --> | |
| <button | |
| onclick="navigator.clipboard.writeText('{{ $text }}')" | |
| class="px-3 py-1 rounded bg-gray-800 text-white" | |
| > | |
| Copy | |
| </button> | |
| Usage | |
| <x-copy text="My secret code" /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment