3.2.0 • Published 2 years ago

copy-text-to-clipboard v3.2.0

Weekly downloads
144,382
License
MIT
Repository
github
Last release
2 years ago

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

import copy from '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
@xcop/fr-generatordocz-theme-umi-yformfr-generator-enkbc-ui-cli-v2iot-platform-packagetest-fr-generator@bruceye/fr-generator-englishdocz-theme-keuitxmeta@go-ui/utils@everything-registry/sub-chunk-1380@pxwlab/docz-theme-katanasuper-fr-generatorsvelte-yagameswodax-docz-theme-umixiaodhuang-fr-generatorstong-uitest-trackingth-fr-generatorvitepress-rcvconsolevconsolelogsvconsole-exportvconsole-export-logsvconsole-fixed-sse-streamvoya@docusaurus/theme-classic@csod-oss/docz-theme@coocoon/fr-generator@douyinfe/semi-ui@douyinfe/semi-site-playground@cailei/cli@roseys/docz-theme@payburner/payburner-payid-card@payburner/paybutton.js@roothub/docz-theme-umivjira-extension-scriptissue-reporter-webitdkjhit_chatkeepix-application-interfacekhulnasoft-apptracing-paneltxgw-docusaurus-theme-openapi-docsudesign-uituns-component-themeuat-schema-generatortheme-openapi-writedocstrack-test-222trioslibutfsrb-ui-kit@aolchik/netlify-cms-core@arkntools/vconsole@admin_zte/customerform@aliceoq/library-test@aligov/gov-schema-config-view@axe312/gatsby-theme-docz@bamboo-dev/cli@bill-doc/doc-theme-gatsby@bruceye/fr-generator-medisys@careteam/mfe-lowcode-render@clone-yangson/fr-generator-hyx@cloudcatalog/core@cloudcatalog/core-test@3rd/vant-cli-v2@acid-info/logos-docusaurus-theme@dcbfe/utils@dialectik/compiler@coolversion/schema-generatorzart-clixxh-vuiyy-uizy-plugin-vconsolevue3-copyzl-generator@hashicorp/octavo@forgettingpasswords/netlify-cms-core@foxpage/foxpage-component-editor-widgets@finclip/applet-vconsole@hernas/docusaurus-theme-openapi-docs@henryong/fr-generator@ice/pkg-plugin-docusarus@ice/pkg-plugin-docusaurus@fescotech/form-designer@elv1n/docz-theme-default@ftvs/utils@go-ui/demo-frame@kyfe/ksui-cli@kousum/semi-ui-vue@kyoung18/netlify-cms-core@ljm-editor/cli@log4brains/web@loview/cli-plugin-doc@lg-design/fr-generator@madm4ttus3r/l4bweb@mhferrei/catalog@mxenabled/docusaurus-theme-openapi-docs@mypaas/hcm-cli@muijs/cli@entur/alert@f-loat/fr-generator
3.2.0

2 years ago

3.1.0

2 years ago

3.0.1

4 years ago

3.0.0

4 years ago

2.2.0

5 years ago

2.1.1

6 years ago

2.1.0

6 years ago

2.0.0

6 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago