A Better React Copy Component

Gravatar Profile nate-wilkins@code-null.com
Nate-Wilkins
1 min read
Jan 30, 2024

Let's make a better ReactJS

Copy
component.

Wouldn't it be nice if web applications told you when you copied something?

Here's an approach with ReactJS and CSS animations.

Demo

Demo

Dependencies

  • : Copy stuff into clipboard from your browser using JS.

  • : A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • : Serves as the entry point to the DOM and server renderers for React.

  • : Create RFC4122 UUIDs.

Source

Improvements

It would be nice if we could change how long the animation goes for but we're not able to do this inline with CSS

@keyframes
so another solution might be needed.