npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@adopted-ember-addons/ember-cli-clipboard

v1.0.0

Published

An Ember addon that wraps clipboard.js to copy or cut text to the clipboard. A maintained fork of ember-cli-clipboard.

Readme

@adopted-ember-addons/ember-cli-clipboard

A simple Ember wrapper around clipboard.js for copying or cutting text to the clipboard.

Note: This is a maintained fork of ember-cli-clipboard by @jkusa, rebuilt as an Embroider v2 addon and published under the @adopted-ember-addons scope. The original package is unmaintained.

Compatibility

  • Ember.js v5.8 or above
  • Embroider or ember-auto-import v2

Installation

pnpm add @adopted-ember-addons/ember-cli-clipboard

Usage

This addon exposes three public APIs plus a set of test helpers:

<CopyButton> component

import { CopyButton } from '@adopted-ember-addons/ember-cli-clipboard';

<template>
  <CopyButton @text="text to copy" @onSuccess={{this.onSuccess}}>
    Copy
  </CopyButton>
</template>
```∫

`<CopyButton>` renders a `<button class="copy-btn" type="button">` and accepts
all of the modifier arguments below. Splattributes are supported, so you can add
your own `class`, `title`, etc.

| Argument              | Type                                    | Default  | Description                                                                                      |
| --------------------- | --------------------------------------- | -------- | ----------------------------------------------------------------------------------------------- |
| `@text`               | `string` or `(trigger) => string`       | none     | Text to copy. A function is evaluated on click. Takes precedence over `@target`.                |
| `@target`             | `string` or `(trigger) => Element`      | none     | CSS selector or function resolving the element to copy/cut from.                                |
| `@action`             | `'copy'` or `'cut'`                     | `'copy'` | Whether to copy or cut from the target.                                                         |
| `@delegateClickEvent` | `boolean`                               | `true`   | When `true`, the listener is delegated to `document.body`; set `false` to scope to the element. |
| `@container`          | `string` or `HTMLElement`               | none     | Container element (useful inside a `<dialog>` or other focus-trapping element).                 |
| `@onSuccess`          | `(event) => void`                       | none     | Called after a successful copy/cut.                                                             |
| `@onError`            | `(event) => void`                       | none     | Called when the copy/cut fails.                                                                 |

You must provide either `@text` or `@target`.

### `clipboard` modifier

Use the element modifier directly when you don't need the `<CopyButton>` wrapper:

```gjs
import { clipboard } from '@adopted-ember-addons/ember-cli-clipboard';

<template>
  <button
    type="button"
    {{clipboard text="copied via the modifier" onSuccess=this.onSuccess}}
  >
    Copy
  </button>
</template>

The modifier accepts the same named arguments as the component (text, target, action, delegateClickEvent, container, onSuccess, onError).

isClipboardSupported helper

import { isClipboardSupported } from '@adopted-ember-addons/ember-cli-clipboard';

<template>
  {{#if (isClipboardSupported)}}
    Clipboard is supported 🎉
  {{else}}
    Clipboard is not supported 😔
  {{/if}}
</template>

Pass an optional action to check support for copy or cut specifically:

{{#if (isClipboardSupported "cut")}}
  Cut is supported
{{/if}}

The helper returns false in a FastBoot environment.

Test helpers

Fire a button's @onSuccess / @onError actions in tests without real clipboard access:

import { triggerCopySuccess, triggerCopyError } from '@adopted-ember-addons/ember-cli-clipboard/test-support';

test('fires success/error actions', async function (assert) {
  await render(
    <template>
      <CopyButton class="my-btn" @text="text" @onSuccess={{this.onSuccess}} />
    </template>,
  );

  // fire the success action for a specific button
  triggerCopySuccess('.my-btn');

  // omit the selector to default to '.copy-btn'
  triggerCopyError();
});

| Helper | Description | | ------------------------------- | ------------------------------------------------------------------------ | | triggerCopySuccess(selector?) | Fires the @onSuccess action of the matching copy button. | | triggerCopyError(selector?) | Fires the @onError action of the matching copy button. |

Both default to the .copy-btn selector rendered by <CopyButton> when no selector is passed.

Contributing

See the Contributing guide for details.

License

This project is licensed under the MIT License. Original work copyright the ember-cli-clipboard authors; fork modifications copyright aklkv.