{"_id":"@1ohooks/use-copy-to-clipboard","_rev":"1-5f251c3eef4b3adbb02ad795be5bd3e0","name":"@1ohooks/use-copy-to-clipboard","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.0":{"name":"@1ohooks/use-copy-to-clipboard","version":"0.1.0","main":"dist/packages/useCopyToClipboard/src/index.js","types":"dist/packages/useCopyToClipboard/src/index.d.ts","scripts":{"build":"tsc && copyfiles -u 1 src/**/*.{scss,png,jpg} dist/"},"keywords":[],"author":"","license":"ISC","_id":"@1ohooks/use-copy-to-clipboard@0.1.0","_nodeVersion":"18.14.2","_npmVersion":"9.5.1","dist":{"integrity":"sha512-ObihrBK96ZIYnrg9+XDu3QWEcg+EvG1YwnaWSV7jwo1sh8jdnoyhHBrj7dzeSX5/IcXCAjcdgxzRgaA+28kBlQ==","shasum":"32e4da419c0792cef71ae5397c58ef41c0801b4c","tarball":"https://registry.npmjs.org/@1ohooks/use-copy-to-clipboard/-/use-copy-to-clipboard-0.1.0.tgz","fileCount":7,"unpackedSize":2233,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD5s5Ua+4/i5uF+FzBlKEJJJ5O72WXaxxjQph9DwhraygIgWx5ZgdVuUFLbaFLgtyGp5MfLuGduiQcxzmuMUoSwSrQ="}]},"_npmUser":{"name":"1ojames","email":"jameshuntdevelopment@gmail.com"},"directories":{},"maintainers":[{"name":"1ojames","email":"jameshuntdevelopment@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-copy-to-clipboard_0.1.0_1695583131429_0.9158254937861661"},"_hasShrinkwrap":false},"0.1.1":{"name":"@1ohooks/use-copy-to-clipboard","version":"0.1.1","main":"dist/packages/useCopyToClipboard/src/index.js","types":"dist/packages/useCopyToClipboard/src/index.d.ts","scripts":{"build":"tsc && copyfiles -u 1 src/**/*.{scss,png,jpg} dist/"},"keywords":[],"author":"","license":"ISC","description":"`@1ohooks/use-copy-to-clipboard` is a custom React hook that simplifies copying text to the clipboard and provides feedback when the copy operation is successful.","_id":"@1ohooks/use-copy-to-clipboard@0.1.1","_nodeVersion":"18.14.2","_npmVersion":"9.5.1","dist":{"integrity":"sha512-27wUZ0NuXS8XlegnkZMOW7zbMoS6j2Q2Ws1+t55pwO0IA8AFyCuQJE5a+UN3dCIx/IZNOsy8C656fBhb3JzAsw==","shasum":"fb124d1dc176eb33d1d6792e1d8a13011a4d2885","tarball":"https://registry.npmjs.org/@1ohooks/use-copy-to-clipboard/-/use-copy-to-clipboard-0.1.1.tgz","fileCount":8,"unpackedSize":4177,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFJ2FIKhU1DOxBIWQChpaI6LauPZPlLS5+FKlKQ8D6++AiAlZp5CBwNm2VVBAJIp6NVyyTFlz62x8VgzKOr1h6U1VQ=="}]},"_npmUser":{"name":"1ojames","email":"jameshuntdevelopment@gmail.com"},"directories":{},"maintainers":[{"name":"1ojames","email":"jameshuntdevelopment@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-copy-to-clipboard_0.1.1_1695675699537_0.28344610892689226"},"_hasShrinkwrap":false}},"time":{"created":"2023-09-24T19:18:51.289Z","0.1.0":"2023-09-24T19:18:51.621Z","modified":"2023-09-25T21:01:39.955Z","0.1.1":"2023-09-25T21:01:39.734Z"},"maintainers":[{"name":"1ojames","email":"jameshuntdevelopment@gmail.com"}],"keywords":[],"license":"ISC","readme":"# @1ohooks/use-copy-to-clipboard\n\n`@1ohooks/use-copy-to-clipboard` is a custom React hook that simplifies copying text to the clipboard and provides feedback when the copy operation is successful.\n\n## Installation\n\nInstall the package with:\n\n```\nnpm install @1ohooks/use-copy-to-clipboard\n# or\nyarn add @1ohooks/use-copy-to-clipboard\n```\n\n## Usage\n\nTo use the `useCopyToClipboard` hook in your React project, import it and provide the text you want to copy to the clipboard.\n\n```javascript\nimport { useCopyToClipboard } from '@1ohooks/use-copy-to-clipboard';\n\nfunction MyComponent() {\n  const [isCopied, copyToClipboard] = useCopyToClipboard();\n\n  const handleCopyClick = () => {\n    const textToCopy = \"Hello, world!\";\n    copyToClipboard(textToCopy);\n  };\n\n  return (\n    <div>\n      <button onClick={handleCopyClick}>Copy to Clipboard</button>\n      {isCopied && <p>Text copied to clipboard!</p>}\n    </div>\n  );\n}\n```\n\nThe `useCopyToClipboard` hook returns a boolean value `isCopied`, which indicates whether the copy operation was successful, and a function `copyToClipboard` to trigger the copy operation.\n\nThe `isCopied` state is set to `true` when the text is successfully copied to the clipboard and automatically resets after 1.5 seconds to provide user feedback.\n\n## Requirements\n\n- React 16 or higher.\n\n## Contributing\n\nWe welcome contributions from the open-source community to improve and enhance `@1ohooks/use-copy-to-clipboard`. If you have ideas for improvements, new features, or bug fixes, please check out our Contributing Guidelines for more information on how to contribute.\n\n## License\n\n`@1ohooks/use-copy-to-clipboard` is licensed under the MIT License. You are free to use, modify, and distribute it in your projects. We appreciate attribution but do not require it.\n\nThank you for using `@1ohooks/use-copy-to-clipboard` to simplify copying text to the clipboard in your React applications. We hope you find it useful!\n","readmeFilename":"readme.md","description":"`@1ohooks/use-copy-to-clipboard` is a custom React hook that simplifies copying text to the clipboard and provides feedback when the copy operation is successful."}