copy-text-to-clipboard

WebJar for copy-text-to-clipboard

License

License

MIT
Categories

Categories

Github Development Tools Version Controls CLI User Interface
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

github-com-sindresorhus-copy-text-to-clipboard
Last Version

Last Version

1.0.4
Release Date

Release Date

Type

Type

jar
Description

Description

copy-text-to-clipboard
WebJar for copy-text-to-clipboard
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/sindresorhus/copy-text-to-clipboard

Download github-com-sindresorhus-copy-text-to-clipboard

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/github-com-sindresorhus-copy-text-to-clipboard/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>github-com-sindresorhus-copy-text-to-clipboard</artifactId>
    <version>1.0.4</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/github-com-sindresorhus-copy-text-to-clipboard/
implementation 'org.webjars.npm:github-com-sindresorhus-copy-text-to-clipboard:1.0.4'
// https://jarcasting.com/artifacts/org.webjars.npm/github-com-sindresorhus-copy-text-to-clipboard/
implementation ("org.webjars.npm:github-com-sindresorhus-copy-text-to-clipboard:1.0.4")
'org.webjars.npm:github-com-sindresorhus-copy-text-to-clipboard:jar:1.0.4'
<dependency org="org.webjars.npm" name="github-com-sindresorhus-copy-text-to-clipboard" rev="1.0.4">
  <artifact name="github-com-sindresorhus-copy-text-to-clipboard" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='github-com-sindresorhus-copy-text-to-clipboard', version='1.0.4')
)
libraryDependencies += "org.webjars.npm" % "github-com-sindresorhus-copy-text-to-clipboard" % "1.0.4"
[org.webjars.npm/github-com-sindresorhus-copy-text-to-clipboard "1.0.4"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

copy-text-to-clipboard

Copy text to the clipboard in modern browsers (0.2 kB)

Try it out!

Comparison

Install

$ npm install copy-text-to-clipboard

Usage

const copy = require('copy-text-to-clipboard');

button.addEventListener('click', () => {
	copy('๐Ÿฆ„๐ŸŒˆ');
});

API

copy(text, options?)

Copy text to the clipboard.

Returns a boolean of whether it succeeded to copy the text.

Must be called in response to a user gesture event, like click or keyup.

options

Type: object

target

Type: HTMLElement
Default: document.body

Specify a DOM element where the temporary, behind-the-scenes textarea should be appended, in cases where you need to stay within a focus trap, like in a modal.

Related

  • clipboardy - Access the system clipboard (copy/paste) in Node.js

Versions

Version
1.0.4