{"id":15007623,"url":"https://github.com/charlesstover/use-clippy","last_synced_at":"2025-04-05T22:04:40.082Z","repository":{"id":34305817,"uuid":"176777348","full_name":"CharlesStover/use-clippy","owner":"CharlesStover","description":"React Hook for reading from and writing to the user's clipboard.","archived":false,"fork":false,"pushed_at":"2022-11-09T23:32:26.000Z","size":1022,"stargazers_count":181,"open_issues_count":17,"forks_count":11,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-05-10T18:58:11.279Z","etag":null,"topics":["clipboard","clipboard-api","clipboard-copy","clipboard-javascript","clipboard-js","clipboard-management","clipboard-manager","clipboard-managers","clipboard-modifier","javascript","npm","npmjs","react","react-hooks","reactjs","travis","travis-ci","travisci","typescript"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/use-clippy","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CharlesStover.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-03-20T16:46:55.000Z","updated_at":"2024-04-28T00:37:37.000Z","dependencies_parsed_at":"2023-01-15T06:15:47.818Z","dependency_job_id":null,"html_url":"https://github.com/CharlesStover/use-clippy","commit_stats":null,"previous_names":["quisido/use-clippy","charlesstover/use-clippy"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CharlesStover%2Fuse-clippy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CharlesStover%2Fuse-clippy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CharlesStover%2Fuse-clippy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CharlesStover%2Fuse-clippy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CharlesStover","download_url":"https://codeload.github.com/CharlesStover/use-clippy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247406085,"owners_count":20933803,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["clipboard","clipboard-api","clipboard-copy","clipboard-javascript","clipboard-js","clipboard-management","clipboard-manager","clipboard-managers","clipboard-modifier","javascript","npm","npmjs","react","react-hooks","reactjs","travis","travis-ci","travisci","typescript"],"created_at":"2024-09-24T19:12:36.373Z","updated_at":"2025-04-05T22:04:40.058Z","avatar_url":"https://github.com/CharlesStover.png","language":"TypeScript","readme":"# useClippy [![Tweet](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?text=useClippy%20lets%20you%20manage%20your%20users'%20clipboards%20with%20a%20React%20hook.\u0026url=https://github.com/CharlesStover/use-clippy\u0026via=CharlesStover\u0026hashtags=react,reactjs,javascript,typescript,webdev,webdevelopment) [![version](https://img.shields.io/npm/v/use-clippy.svg)](https://www.npmjs.com/package/use-clippy) [![minified size](https://img.shields.io/bundlephobia/min/use-clippy.svg)](https://www.npmjs.com/package/use-clippy) [![minzipped size](https://img.shields.io/bundlephobia/minzip/use-clippy.svg)](https://www.npmjs.com/package/use-clippy) [![downloads](https://img.shields.io/npm/dt/use-clippy.svg)](https://www.npmjs.com/package/use-clippy) [![build](https://api.travis-ci.com/CharlesStover/use-clippy.svg)](https://travis-ci.com/CharlesStover/use-clippy/)\n\n`useClippy` is a TypeScript-friendly React hook for reading from and writing to\nthe user's clipboard.\n\n_Not to be confused with Microsoft Office's assistant, Clippy._ 📎\n\n## Demo\n\nYou can see\n[`use-clippy` in action via GitHub Pages](https://charlesstover.github.io/use-clippy/),\nwhich hosts the\n[`demo`](https://github.com/CharlesStover/use-clippy/tree/master/demo) directory.\n\n## Install\n\n- `npm install use-clippy` or\n- `yarn add use-clippy`\n\n## Use\n\n`useClippy()` returns a tuple analogous to `useState`, where the first item is\nthe clipboard contents and the second item is a function for setting the\nclipboard contents.\n\n```JavaScript\nimport React from 'react';\nimport useClippy from 'use-clippy';\n\nexport default function MyComponent() {\n\n  // clipboard is the contents of the user's clipboard.\n  // setClipboard('new value') wil set the contents of the user's clipboard.\n  const [clipboard, setClipboard] = useClippy();\n\n  return (\n    \u003cdiv\u003e\n\n      {/* Button that demonstrates reading the clipboard. */}\n      \u003cbutton\n        onClick={() =\u003e {\n          alert(`Your clipboard contains: ${clipboard}`);\n        }}\n      \u003e\n        Read my clipboard\n      \u003c/button\u003e\n\n      {/* Button that demonstrates writing to the clipboard. */}\n      \u003cbutton\n        onClick={() =\u003e {\n          setClipboard(`Random number: ${Math.random()}`);\n        }}\n      \u003e\n        Copy something new\n      \u003c/button\u003e\n    \u003c/div\u003e\n  );\n}\n```\n\n## Sponsor 💗\n\nIf you are a fan of this project, you may\n[become a sponsor](https://github.com/sponsors/CharlesStover)\nvia GitHub's Sponsors Program.\n","funding_links":["https://github.com/sponsors/CharlesStover"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcharlesstover%2Fuse-clippy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcharlesstover%2Fuse-clippy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcharlesstover%2Fuse-clippy/lists"}