Skip to content
R

react-copy-to-clipboard

Copy-to-clipboard React component

by nkbtFree

#63in UI Libraries
0In stores

Description

react-copy-to-clipboard is a React component that copies text to the clipboard when a user clicks its child element. It is based on the copy…

Highlights

  • Copies text on click of a child element
  • onCopy callback with success result
  • Fallbacks for older browsers
  • Debug, message and format options

Ratings & Reviews

No ratings yet

Be the first to rate react-copy-to-clipboard.

People also visit

R

react-clipboard.js

Clipboard.js wrapper for ReactJS

UI Libraries
Launch
R

react-text-truncate

Truncate text for React.js

UI Libraries
Launch
R

react-codemirror

Codemirror

UI Libraries
Launch
R

react-sidebar

A sidebar component for React

UI Libraries
Launch
R

react-collapsible

React component to wrap content in Collapsible element

UI Libraries
Launch
R

react-multiline-clamp

React component that uses the css line clamping

UI Libraries
Launch

react-copy-to-clipboard FAQ

What does react-copy-to-clipboard do?

It copies a text prop to the clipboard when the user clicks the child element inside it.

How do I install it?

With Yarn or npm. If you use npm@3, install the react peer dependency yourself.

How do I know if the copy worked?

The onCopy callback receives a result that is true when the text was copied, and false otherwise.

What happens in browsers without clipboard support?

The component falls back from execCommand to the IE clipboardData interface, and finally shows a prompt with the text to copy by hand.

What license is it under?

MIT, according to the README.

What are the best react-copy-to-clipboard alternatives?

Popular alternatives to react-copy-to-clipboard include react-clipboard.js, react-text-truncate and react-codemirror. See all react-copy-to-clipboard alternatives

Developer Stuff

Badges