{"id":18338697,"url":"https://github.com/tableflip/react-copy-text","last_synced_at":"2025-04-06T05:31:49.313Z","repository":{"id":72910911,"uuid":"112733629","full_name":"tableflip/react-copy-text","owner":"tableflip","description":"Copy text to the clipboard like it's 1999","archived":false,"fork":false,"pushed_at":"2018-01-23T08:48:15.000Z","size":75,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-18T13:05:56.473Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/react-copy-text","language":"JavaScript","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/tableflip.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-12-01T11:41:41.000Z","updated_at":"2020-07-08T15:32:03.000Z","dependencies_parsed_at":null,"dependency_job_id":"ae03d0f6-6ef1-4b07-b371-fca7cbe29331","html_url":"https://github.com/tableflip/react-copy-text","commit_stats":{"total_commits":6,"total_committers":1,"mean_commits":6.0,"dds":0.0,"last_synced_commit":"572207698b53656754d9b058014c613f7d3e76c6"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tableflip%2Freact-copy-text","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tableflip%2Freact-copy-text/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tableflip%2Freact-copy-text/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tableflip%2Freact-copy-text/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tableflip","download_url":"https://codeload.github.com/tableflip/react-copy-text/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247440346,"owners_count":20939221,"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":[],"created_at":"2024-11-05T20:14:54.144Z","updated_at":"2025-04-06T05:31:49.297Z","avatar_url":"https://github.com/tableflip.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-copy-text\n\n[![Build Status](https://travis-ci.org/tableflip/react-copy-text.svg?branch=master)](https://travis-ci.org/tableflip/react-copy-text) [![dependencies Status](https://david-dm.org/tableflip/react-copy-text/status.svg)](https://david-dm.org/tableflip/react-copy-text) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)\n\n\u003e Copy text to the clipboard like it's 1999\n\nBeautifully simples React component to copy the `text` you give to it, with optional `onCopied` callback so you know when it's done.\n\n## Install\n\n```sh\nnpm install react-copy-text\n```\n\n## Usage\n\n```js\nimport React, { Component } from 'react'\nimport CopyText from 'react-copy-text'\n\nexport default class App extends Component {\n  state = {textToCopy: ''}\n\n  onButtonClick = () =\u003e this.setState({ textToCopy: 'NOW: ' + Date.now() })\n  onCopied = (text) =\u003e console.log(`${text} was copied to the clipboard`)\n\n  render () {\n    return (\n      \u003cdiv\u003e\n        \u003cbutton onClick={this.onButtonClick}\u003eCopy some text\u003c/button\u003e\n        \u003cCopyText text={this.state.textToCopy} onCopied={this.onCopied} /\u003e\n      \u003c/div\u003e\n    )\n  }\n}\n```\n\n## API\n\n### `\u003cCopyText /\u003e`\n\n#### `text`\n\nType: `PropTypes.string`\n\nThe text to copy to the clipboard.\n\n#### `onCopied`\n\nType: `PropTypes.func`\n\nCallback function called after the text has been copied to the clipboard. Passed the text that was copied.\n\n## Contribute\n\nFeel free to dive in! [Open an issue](https://github.com/tableflip/react-copy-text/issues/new) or submit PRs.\n\n## License\n\n[MIT](LICENSE) © Alan Shaw\n\n---\n\nA [(╯°□°）╯︵TABLEFLIP](https://tableflip.io) side project.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftableflip%2Freact-copy-text","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftableflip%2Freact-copy-text","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftableflip%2Freact-copy-text/lists"}