PHPackages                             zeroclipboard/zeroclipboard - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. zeroclipboard/zeroclipboard

AbandonedArchivedComponent[Utility &amp; Helpers](/categories/utility)

zeroclipboard/zeroclipboard
===========================

The ZeroClipboard library provides an easy way to copy text to the clipboard using an invisible Adobe Flash movie and a JavaScript interface

v2.3.0(9y ago)6.6k279.0k↓34.4%1.0k[76 issues](https://github.com/zeroclipboard/zeroclipboard/issues)[3 PRs](https://github.com/zeroclipboard/zeroclipboard/pulls)1MITJavaScript

Since Oct 30Pushed 5y ago247 watchersCompare

[ Source](https://github.com/zeroclipboard/zeroclipboard)[ Packagist](https://packagist.org/packages/zeroclipboard/zeroclipboard)[ Docs](http://zeroclipboard.org/)[ RSS](/packages/zeroclipboard-zeroclipboard/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)DependenciesVersions (32)Used By (1)

### ⚠️ WARNING!

[](#warning-warning)

This library is no longer maintained as it is no longer necessary for modern web development. If you want your frontend JavaScript to manipulate the clipboard, please look into the new HTML Clipboard API (various docs available on MDN) or a small convenience wrapper around it like [clipboard.js](https://github.com/zenorocha/clipboard.js). Thanks for all your support, this project was a labor of love for many years. ❤️

---

#### Note:

[](#note)

**This `master` branch contains the `v2.x` codebase for ZeroClipboard! For the `v1.x` codebase, see the [`1.x-master`](https://github.com/zeroclipboard/zeroclipboard/tree/1.x-master) branch instead.**

ZeroClipboard
=============

[](#zeroclipboard)

[![GitHub Latest Release](https://camo.githubusercontent.com/9fc62048387e91bd97bf420f3eb23cc5daf93dc7fe1e75134b7f5a0709a64e02/68747470733a2f2f62616467652e667572792e696f2f67682f7a65726f636c6970626f6172642532467a65726f636c6970626f6172642e737667)](https://github.com/zeroclipboard/zeroclipboard) [![Build Status](https://camo.githubusercontent.com/3f8e52fe41abfaa71855bce028a4675776b83fa04c316a0c90d574e6c2454332/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f7a65726f636c6970626f6172642f7a65726f636c6970626f6172642e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/zeroclipboard/zeroclipboard) [![GZip Size](https://camo.githubusercontent.com/f2000bceb90a6c89cb66bbc1a245452019318a3ecd2257186cfaec08183d3ff0/68747470733a2f2f62616467652d73697a652e6865726f6b756170702e636f6d2f7a65726f636c6970626f6172642f7a65726f636c6970626f6172642f6d61737465722f646973742f5a65726f436c6970626f6172642e6d696e2e6a733f636f6d7072657373696f6e3d677a6970)](https://camo.githubusercontent.com/f2000bceb90a6c89cb66bbc1a245452019318a3ecd2257186cfaec08183d3ff0/68747470733a2f2f62616467652d73697a652e6865726f6b756170702e636f6d2f7a65726f636c6970626f6172642f7a65726f636c6970626f6172642f6d61737465722f646973742f5a65726f436c6970626f6172642e6d696e2e6a733f636f6d7072657373696f6e3d677a6970) [![Coverage Status](https://camo.githubusercontent.com/4d6f772e35ad5056932bec83adfc8ae7b0dd49679b4d27fa5dba590e69418b49/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f7a65726f636c6970626f6172642f7a65726f636c6970626f6172642f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/r/zeroclipboard/zeroclipboard?branch=master) [![Dependency Status](https://camo.githubusercontent.com/2b08adccb6c26e6119d127a639610d3b7c15a799fe6795b142987ddec4c4a74b/68747470733a2f2f64617669642d646d2e6f72672f7a65726f636c6970626f6172642f7a65726f636c6970626f6172642e7376673f7468656d653d736869656c64732e696f)](https://david-dm.org/zeroclipboard/zeroclipboard) [![Dev Dependency Status](https://camo.githubusercontent.com/7365a4464b9add5bdc87ebd56073c4fb0213c02e54b0adcd71e3f51f02a2ce4b/68747470733a2f2f64617669642d646d2e6f72672f7a65726f636c6970626f6172642f7a65726f636c6970626f6172642f6465762d7374617475732e7376673f7468656d653d736869656c64732e696f)](https://david-dm.org/zeroclipboard/zeroclipboard#info=devDependencies)

The ZeroClipboard library provides an easy way to copy text to the clipboard using an invisible [Adobe Flash](http://en.wikipedia.org/wiki/Adobe_Flash) movie and a [JavaScript](http://en.wikipedia.org/wiki/JavaScript) interface. The "Zero" signifies that the library is invisible and the user interface is left entirely up to you.

This is achieved by automatically floating the invisible movie on top of a [DOM](http://en.wikipedia.org/wiki/Document_Object_Model) element of your choice. Standard mouse events are even propagated out to your DOM element, so you can still have rollover and mousedown effects.

Suggestions welcome read over the [contributing](/CONTRIBUTING.md) guidelines.

Setup
-----

[](#setup)

To setup the project for local development start with these commands in your terminal.

```
$ git clone https://github.com/zeroclipboard/zeroclipboard.git
$ cd zeroclipboard/
$ npm install -g grunt-cli
$ npm install
$ grunt
```

Development
-----------

[](#development)

Before submitting a pull request you'll need to validate, build, and test your code. Run the default grunt task in your terminal.

```
$ grunt
```

Testing
-------

[](#testing)

If you just want to run the tests, run grunt test.

```
$ grunt test
```

Limitations
-----------

[](#limitations)

### User Interaction Required

[](#user-interaction-required)

Due to browser and Flash security restrictions, this clipboard injection can ***ONLY*** occur when the user clicks on the invisible Flash movie. A simulated `click` event from JavaScript will not suffice as this would enable [clipboard poisoning](http://www.computerworld.com/s/article/9117268/Adobe_patches_Flash_clickjacking_and_clipboard_poisoning_bugs).

### Other Limitations

[](#other-limitations)

For a complete list of limitations, see [docs/instructions.md#limitations](docs/instructions.md#limitations).

On that page, you will also find an [explanation of why ZeroClipboard will *NOT* work by default on code playground sites](docs/instructions.md#starter-snippets-for-playground-sites) like JSFiddle, JSBin, and CodePen, as well as the appropriate "View" URLs to use on those sites in order to allow ZeroClipboard to work.

Simple Example
--------------

[](#simple-example)

```

    Copy to Clipboard

```

```
// main.js
var client = new ZeroClipboard( document.getElementById("copy-button") );

client.on( "ready", function( readyEvent ) {
  // alert( "ZeroClipboard SWF is ready!" );

  client.on( "aftercopy", function( event ) {
    // `this` === `client`
    // `event.target` === the element that was clicked
    event.target.style.display = "none";
    alert("Copied text to clipboard: " + event.data["text/plain"] );
  } );
} );
```

See [docs/instructions.md](docs/instructions.md) for more advanced options in using the library on your site. See [docs/api/ZeroClipboard.md](docs/api/ZeroClipboard.md) for the complete API documentation.

Here is a working [test page](http://zeroclipboard.github.io/#demo) where you can try out ZeroClipboard in your browser.

Testing ZeroClipboard Locally
-----------------------------

[](#testing-zeroclipboard-locally)

To test the page [demo page](http://zeroclipboard.github.io/#demo) locally, clone the [website repo](https://github.com/zeroclipboard/zeroclipboard.github.io).

Support
-------

[](#support)

This library is fully compatible with Flash Player 11.0.0 and above, which requires that the clipboard copy operation be initiated by a user click event inside the Flash movie. This is achieved by automatically floating the invisible movie on top of a [DOM](http://en.wikipedia.org/wiki/Document_Object_Model) element of your choice. Standard mouse events are even propagated out to your DOM element, so you can still have rollover and mousedown effects with just a *little* extra effort.

ZeroClipboard `v2.x` is expected to work in IE9+ and all of the evergreen browsers. Although support for IE7 &amp; IE8 was officially dropped in `v2.0.0`, it was actually still *technically* supported through `v2.0.2`.

Releases
--------

[](#releases)

Starting with version [1.1.7](https://github.com/zeroclipboard/zeroclipboard/releases/tag/v1.1.7), ZeroClipboard uses [semantic versioning](http://semver.org/).

see [releases](https://github.com/zeroclipboard/zeroclipboard/releases)

Related
-------

[](#related)

- [jquery.zeroclipboard](https://github.com/zeroclipboard/jquery.zeroclipboard)
- [zeroclipboard-rails](https://github.com/zeroclipboard/zeroclipboard-rails)

License
-------

[](#license)

MIT © [James M. Greene](http://greene.io/) [Jon Rohan](http://jonrohan.codes)

###  Health Score

53

—

FairBetter than 97% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity66

Solid adoption and visibility

Community42

Growing community involvement

Maturity74

Established project with proven stability

 Bus Factor1

Top contributor holds 55.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~39 days

Recently: every ~223 days

Total

30

Last Release

3445d ago

Major Versions

1.3.5 → 2.0.0-beta.12014-04-15

### Community

Maintainers

![](https://www.gravatar.com/avatar/9e6d1faddf9a4ff8c93519e01259e67682fc55b1af7ecc8beb696bee808559cc?d=identicon)[zeroclipboard](/maintainers/zeroclipboard)

---

Top Contributors

[![jonrohan](https://avatars.githubusercontent.com/u/54012?v=4)](https://github.com/jonrohan "jonrohan (357 commits)")[![JamesMGreene](https://avatars.githubusercontent.com/u/417751?v=4)](https://github.com/JamesMGreene "JamesMGreene (226 commits)")[![jrolfs](https://avatars.githubusercontent.com/u/288160?v=4)](https://github.com/jrolfs "jrolfs (8 commits)")[![TooTallNate](https://avatars.githubusercontent.com/u/71256?v=4)](https://github.com/TooTallNate "TooTallNate (6 commits)")[![rimian](https://avatars.githubusercontent.com/u/64749?v=4)](https://github.com/rimian "rimian (4 commits)")[![bowsersenior](https://avatars.githubusercontent.com/u/40264?v=4)](https://github.com/bowsersenior "bowsersenior (3 commits)")[![Stereobit](https://avatars.githubusercontent.com/u/150493?v=4)](https://github.com/Stereobit "Stereobit (3 commits)")[![lhecker](https://avatars.githubusercontent.com/u/2256941?v=4)](https://github.com/lhecker "lhecker (3 commits)")[![adamyonk](https://avatars.githubusercontent.com/u/33258?v=4)](https://github.com/adamyonk "adamyonk (2 commits)")[![afc163](https://avatars.githubusercontent.com/u/507615?v=4)](https://github.com/afc163 "afc163 (2 commits)")[![andyluss](https://avatars.githubusercontent.com/u/197572?v=4)](https://github.com/andyluss "andyluss (2 commits)")[![avlukanin](https://avatars.githubusercontent.com/u/1560148?v=4)](https://github.com/avlukanin "avlukanin (2 commits)")[![IonicaBizau](https://avatars.githubusercontent.com/u/2864371?v=4)](https://github.com/IonicaBizau "IonicaBizau (2 commits)")[![robotdan](https://avatars.githubusercontent.com/u/1148709?v=4)](https://github.com/robotdan "robotdan (2 commits)")[![thadseaver](https://avatars.githubusercontent.com/u/8334645?v=4)](https://github.com/thadseaver "thadseaver (2 commits)")[![hallvors](https://avatars.githubusercontent.com/u/120136?v=4)](https://github.com/hallvors "hallvors (1 commits)")[![huebs](https://avatars.githubusercontent.com/u/1166532?v=4)](https://github.com/huebs "huebs (1 commits)")[![AndrewRayCode](https://avatars.githubusercontent.com/u/79215?v=4)](https://github.com/AndrewRayCode "AndrewRayCode (1 commits)")[![CMTegner](https://avatars.githubusercontent.com/u/820552?v=4)](https://github.com/CMTegner "CMTegner (1 commits)")[![bundyo](https://avatars.githubusercontent.com/u/98318?v=4)](https://github.com/bundyo "bundyo (1 commits)")

---

Tags

adobe-flashadobe-flexapache-flexclipboarddomflashfrontendjavascriptwebzeroclipboardcopyflashclipboardcutpastezclipclipclippy

### Embed Badge

![Health badge](/badges/zeroclipboard-zeroclipboard/health.svg)

```
[![Health](https://phpackages.com/badges/zeroclipboard-zeroclipboard/health.svg)](https://phpackages.com/packages/zeroclipboard-zeroclipboard)
```

###  Alternatives

[myclabs/deep-copy

Create deep copies (clones) of your objects

8.9k849.8M169](/packages/myclabs-deep-copy)[plasticbrain/php-flash-messages

A modern take on PHP session-based flash messages

184229.6k8](/packages/plasticbrain-php-flash-messages)[coderello/laraflash

Advanced flash messages for Laravel.

15737.2k1](/packages/coderello-laraflash)[caffeinated/flash

Flash Messages for Laravel

4649.5k2](/packages/caffeinated-flash)[cartalyst/alerts

Alerts allows you to easily pass alert messages to your Laravel views.

3064.2k](/packages/cartalyst-alerts)[sabre/amf

SabreAMF is a Flash Remoting server and client for PHP

415.9k1](/packages/sabre-amf)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
