clipboard.js
JavaScript library that copies text to the clipboard when a user activates an element, with no Flash dependency.
clipboard.js copies text to the clipboard when a user clicks an element. The text can come from a data attribute, from the value or text of another element, or from a function that returns a string or a node. A cut action removes the text from an input or textarea instead. The library attaches one listener through event delegation and fires success and error events for the page to respond to. It includes no CSS or tooltip; the README suggests showing the feedback in the page.
Worth knowing
Copying depends on the Selection and execCommand browser APIs. The README says the library degrades for older browsers, where the page should tell the visitor to press the keyboard shortcut, because the text is already selected.
Identity
- Status
- Stub
- Maintainer
- Zeno Rocha3
- Maintained by
- Individual3
- First release
- 20154
Rendering and deploy
- Install with
- npm5
Releases
Adoption
Sources
- 2026-11-04: links
clipboardjs.com/ - 2026-11-04: links, Written in, License, License model, GitHub stars
api.github.com/repos/zenorocha/clipboard.js - 2026-11-04: Maintainer, Maintained by
github.com/zenorocha/clipboard.js/blob/master/LICENSE - 2026-11-04: First release
api.github.com/repos/zenorocha/clipboard.js/releases - 2026-11-04: Install with
github.com/zenorocha/clipboard.js/blob/master/readme.md - 2026-11-04: Current major version, Last release
api.github.com/repos/zenorocha/clipboard.js/releases/latest - 2026-11-04: npm downloads a week
api.npmjs.org/downloads/range/2026-10-26:2026-11-01/clipboard - 2026-11-04: Contributors
api.github.com/repos/zenorocha/clipboard.js/contributors - 2026-11-04: Dependent packages, Dependent repositories
packages.ecosyste.ms/api/v1/registries/npmjs.org/packages/clipboard