Gathering detailed insights and metrics for @andreasnicolaou/ngx-copy-to-clipboard
Gathering detailed insights and metrics for @andreasnicolaou/ngx-copy-to-clipboard
Gathering detailed insights and metrics for @andreasnicolaou/ngx-copy-to-clipboard
Gathering detailed insights and metrics for @andreasnicolaou/ngx-copy-to-clipboard
NgxCopyToClipboard is an Angular directive that enables easy text copying to the clipboard with a single click. It supports customizable success/error messages and triggers events on copy actions.
npm install @andreasnicolaou/ngx-copy-to-clipboard
Typescript
Module System
Node Version
NPM Version
63.8
Supply Chain
96
Quality
82.1
Maintenance
100
Vulnerability
100
License
TypeScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
3 Stars
31 Commits
1 Forks
1 Watchers
4 Branches
1 Contributors
Updated on May 13, 2025
Latest Version
3.1.0
Package Id
@andreasnicolaou/ngx-copy-to-clipboard@3.1.0
Unpacked Size
15.05 kB
Size
4.89 kB
File Count
9
NPM Version
11.3.0
Node Version
22.13.1
Published on
May 13, 2025
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
1
2
Click to copy — a fast, lightweight Angular directive to copy text to the clipboard using the modern Clipboard API.
The ngxCopyToClipboard directive provides a seamless way for users to quickly copy content without the need to manually select or retype it. This is especially useful in forms, code snippets, confirmation flows, and other UI/UX scenarios where content needs to be reused.
1npm i --save @andreasnicolaou/ngx-copy-to-clipboard
🟢 For Angular 15+ (Standalone Projects)
You can directly import the directive into any standalone component:
1import { NgxCopyToClipboardDirective } from '@andreasnicolaou/ngx-copy-to-clipboard'; 2 3@Component({ 4 standalone: true, 5 selector: 'your-component', 6 imports: [NgxCopyToClipboardDirective], 7 templateUrl: './your-component.html', 8}) 9export class YourComponent {}
🟠 For Angular <15 or Module-Based Projects
Use the provided NgxCopyToClipboardModule:
1import { NgxCopyToClipboardModule } from '@andreasnicolaou/ngx-copy-to-clipboard'; 2 3@NgModule({ 4 declarations: [], 5 imports: [NgxCopyToClipboardModule], 6 exports: [], 7}) 8export class YourModule {}
💡 Note: If you're using Angular 15+ but prefer NgModule-based architecture, you can also use the module wrapper for compatibility.
If you’d like to show toasts or notifications when a user copies content, check out my brand new lightweight library — @andreasnicolaou/toastify. It integrates seamlessly and helps you display stylish, customizable toasts with minimal setup!
Name | Type | Description |
---|---|---|
textToCopy | string | Text value to be copied to the clipboard. |
successMessage | string | Optional message emitted on successful copy. Default: 'Successfully copied' . |
errorMessage | string | Optional message emitted on copy failure. Default: 'Could not copy' . |
onCopyEvent | EventEmitter<string> | Emits successMessage when copying succeeds. |
onErrorEvent | EventEmitter<string> | Emits errorMessage when copying fails. |
In the component:
1 const val = 'Hello World!'; 2 3 public onSuccess(ev: string){ 4 console.log(ev); 5 } 6 7 public onError(ev: string){ 8 console.log(ev); 9 } 10
In the template:
1<button 2 ngxCopyToClipboard 3 [textToCopy]="val" 4 [successMessage]="'Copied to Clipboard'" 5 [errorMessage]="'Not copied to Clipboard'" 6 (onCopyEvent)="onSuccess($event)" 7 (onErrorEvent)="onError($event)" 8> 9 Copy 10</button>
If you find this project useful, please star the repo to let people know that it's reliable. Also, share it with friends and colleagues that might find this useful as well. Thank you :smile:
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
6 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 5
Reason
branch protection is not maximal on development and all release branches
Details
Reason
Found 0/24 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More