ai-agent

Copy to Clipboard with clipboard.js

Easily copy text to clipboard with this lightweight tool, ideal for startup founders
34,117 stars3,910 forksJavaScriptGuide quality 8/10Updated 2/12/2026100% free · open source
What it does

Clipboard.js is a lightweight JavaScript tool that allows you to easily copy text to the user's clipboard without using Flash.

When to use it
  • When you need to provide a simple way for users to copy text, such as a password or a coupon code.
  • When you want to enhance the user experience by reducing the number of steps required to copy text.
  • When you need to support older browsers that do not have native copy to clipboard functionality.
Ready-to-paste prompt
new ClipboardJS('.btn', { text: function() { return 'Hello, ' + document.getElementById('name').value; } });
Heads up: Make sure the DOM element with the data-clipboard-text attribute is not hidden or disabled, as this can prevent the copy event from triggering.
Saves to your device
Use with Claude
New

Skip the builder — one click puts this in Claude, Cursor, Antigravity and more.

✅ Light setup

Installs with a command or two; your AI agent can do it for you.

Try it instantly — no install
Claude Code
mkdir -p ~/.claude/skills/clipboard-js && curl -fsSL https://workflowstacks.com/api/skills/clipboard-js/claude-skill -o ~/.claude/skills/clipboard-js/SKILL.md
Open in another AI app

Opens the app with this repo with the prompt ready to go — no copy-paste needed.

Connect the whole catalog (MCP)
claude mcp add --transport http workflowstacks https://workflowstacks.com/api/mcp

Adds a WorkflowStacks connector to Claude Code: search and load any skill here by chatting.

How Copy to Clipboard with clipboard.js works
Codeflow
Free to inspect

Copy to Clipboard with clipboard.js is a tiny JavaScript project (~350 lines across 11 code files, plus 6 test files). Setup is light: installs like a normal app. Reading the code is optional. Last commit 6 months ago, MIT license, has a test suite.

Size
Tiny codebase
~350 lines · 11 code files · 3 min skim
Setup
One-command install
Installs like a normal app. Reading the code is optional.
Runs on
Node.js
No API keys detected
JavaScript 99%TypeScript 1%
Where to start reading
  1. 1
    readme.md
    Start here — what it does and how to install it
  2. 2
    composer.json
    Dependencies and the commands it exposes
  3. 3
    src/clipboard.d.ts
    Inside src/ — the main logic begins here
  4. 4
    demo/constructor-node.html
    A worked example — copy this to get going
What's in each folder
src/Core code — the actual logic8 files
demo/Examples you can copy12 files
.github/CI / automation (GitHub Actions)7 files
test/Tests — proof it works6 files
.husky/Tool / agent settings2 files
READMEHas testsDocumentedCI checksExamples includedMIT licenseLast update 6 mo ago
Quick Actions
Details
Creator
zenorocha
Language
JavaScript
Category
ai-agent
Published
9/18/2015

Are you the creator of this tool? Claim your listing → and earn 85% of every sale.