clipboard.js

A modern, Flash-free JavaScript library for copying and cutting text to the clipboard

Library
npm
v2.0.11
34,124stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
55/100Fair
Development Activity4
Maintenance32
Community84
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
78/100Good
Architecture76
Code Quality80
Innovation65
Learning Curve92

clipboard.js is a small JavaScript library that adds copy-to-clipboard and cut-to-clipboard behavior to any DOM element without relying on Flash or requiring inline onclick handlers. It works declaratively by attaching a data-clipboard-target or data-clipboard-text attribute to a trigger element, and internally uses the browser’s execCommand/Clipboard APIs behind a small event-emitter-based API.

The library ships no framework dependency and is commonly embedded in documentation sites, code-snippet blocks, and share/link buttons where a single click needs to copy specific text without a page reload or plugin.

What You Get

  • Declarative copy/cut triggers via data-clipboard-target or data-clipboard-text attributes
  • No Flash dependency — pure JavaScript wrapping native browser clipboard APIs
  • A small event emitter API (success/error events) for custom UI feedback (e.g. “Copied!” tooltips)
  • Framework-agnostic usage, plus TypeScript type definitions bundled in the package
  • A tiny bundle size (a few kilobytes gzipped) suitable for documentation and marketing sites

Common Use Cases

  • “Copy code” buttons on documentation sites and code-snippet blocks
  • “Copy link” or “copy referral code” buttons on marketing and account pages
  • Copying generated values (API keys, invite codes, share URLs) to the clipboard with one click
  • Adding clipboard support to static sites or CMS-driven pages without a full JS framework

Under The Hood

Architecture: The core (src/clipboard.js, ~165 lines) is a class extending a small tiny-emitter-based event emitter, delegating actual clipboard mutation to two action modules under src/actions/ (copy and cut), and using the good-listener and select helper packages for event delegation and text selection respectively. This separation keeps the core class focused on wiring DOM events to the appropriate action rather than implementing selection/copy logic inline.

Tech Stack: Plain JavaScript (ES5-targeted output) with three small first-party-maintained dependencies (good-listener, select, tiny-emitter) rather than a large dependency tree; built via Webpack for the distributable bundle and tested with Karma across real browsers.

Code Quality: The test/ directory mirrors the src/ structure (actions/, common/), indicating unit coverage per module rather than only integration tests. TypeScript definitions (clipboard.d.ts) and a .test-d.ts type-test file show attention to consumer type safety despite the library itself being plain JS.

API Design: The declarative data-clipboard-target/data-clipboard-text attribute API is the library’s signature ergonomic choice — it lets developers add copy behavior without writing any imperative JS beyond instantiating new ClipboardJS(selector), making the learning curve very shallow for the common case.

Used by 12 apps in this directory

TypeScript
72%
AGPL 3.0

APITable

Low Code Platforms · Databases

15,526

API-first collaborative spreadsheet-database platform that auto-generates REST APIs and lets teams build internal tools, CRMs, and dashboards without code.

View details
53
Repo Health
77
Technical
60
Dependency
Built with
TypeScript72%
Java22%
Updated 9 months ago
Go
86%
Apache 2.0

Authelia

Security · Authentication

28,626

OpenID Certified SSO and MFA portal for securing self-hosted web applications behind reverse proxies.

View details
91
Repo Health
81
Technical
77
Dependency
Built with
Go86%
TypeScript12%
Updated today
Go
39%
MIT

ezBookkeeping

Invoicing Finance

5,424

Lightweight self-hosted personal finance manager with AI receipt scanning, multi-currency support, and MCP integration for complete data privacy.

View details
88
Repo Health
80
Technical
75
Dependency
Built with
Go39%
Vue33%
TypeScript25%
Updated yesterday
Ruby
67%
Other

GitLab

Devops · Developer Tools

24,533

The complete DevOps platform that unifies Git hosting, CI/CD, issue tracking, and security scanning into a single self-hostable application.

View details
87
Repo Health
86
Technical
70
Dependency
Built with
Ruby67%
JavaScript20%
Updated today
Go
62%
MIT

hoop

Security · Monitoring

791

A wire-protocol gateway that enforces data masking, command blocking, approval workflows, and full session recording for engineers and AI agents accessing production infrastructure.

View details
86
Repo Health
80
Technical
66
Dependency
Built with
Go62%
Clojure20%
JavaScript10%
Updated yesterday
PHP
85%
Other

Invoice Ninja

Invoicing Finance · Project Management

10,008

Self-hostable invoicing, time-tracking, and multi-gateway payment platform for freelancers and small businesses, with built-in e-invoicing compliance for EU and global standards.

View details
97
Repo Health
83
Technical
62
Dependency
Built with
PHP85%
XSLT10%
Updated 2 days ago
JavaScript
87%
GPL 3.0

NodeBB

Community

15,199

Modern Node.js forum software with real-time WebSockets, multi-database support, and a plugin ecosystem — the community platform built for the open web and the Fediverse.

View details
97
Repo Health
78
Technical
71
Dependency
Built with
JavaScript87%
Go Template12%
Updated today
TypeScript
91%
MIT

Super Productivity

Productivity · Project Management

21,443

A privacy-respecting, local-first task manager with built-in timeboxing, Pomodoro timer, and deep integrations for Jira, GitHub, GitLab, and CalDAV — no accounts, no data collection, ever.

View details
90
Repo Health
81
Technical
73
Dependency
Built with
TypeScript91%
Updated 2 days ago
PHP
63%
AGPL 3.0

Vanguard Backup

Devops

37

Self-hosted backup automation for Ubuntu and Debian servers with S3 storage, SSH-based file and database backup, and multi-channel notifications.

View details
33
Repo Health
80
Technical
70
Dependency
Built with
PHP63%
Blade36%
Updated 9 months ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search