danoc / React Use Clipboard
Licence: mit
React hook that provides copy to clipboard functionality.
Stars: ✭ 149
Programming Languages
typescript
32286 projects
Projects that are alternatives of or similar to React Use Clipboard
React Nprogress
⌛️ A React primitive for building slim progress bars.
Stars: ✭ 173 (+16.11%)
Mutual labels: hooks, component
Windows User Action Hook
A .NET library to subscribe for Windows operating system global user actions such mouse, keyboard, clipboard & print events
Stars: ✭ 224 (+50.34%)
Mutual labels: hooks, clipboard
React Native Appstate Hook
React Native appSate hook
Stars: ✭ 73 (-51.01%)
Mutual labels: hooks, component
Scrollprogress
🛸 Light weight library to observe the viewport scroll position
Stars: ✭ 148 (-0.67%)
Mutual labels: component
React Osx Dock
React component that is magnifiable like the Mac OS X dock.
Stars: ✭ 136 (-8.72%)
Mutual labels: component
React Native Wormhole
⚛️ 🌌 Inter-dimensional Portals for React Native. 👽 🖖
Stars: ✭ 133 (-10.74%)
Mutual labels: component
Use Clippy
React Hook for reading from and writing to the user's clipboard.
Stars: ✭ 139 (-6.71%)
Mutual labels: clipboard
Esp Azure
SDK to connect ESP8266 and ESP32 to Microsoft Azure IoT services
Stars: ✭ 137 (-8.05%)
Mutual labels: component
React Universal Hooks
🎉 React Universal Hooks : just use****** everywhere (Functional or Class Component). Support React DevTools!
Stars: ✭ 148 (-0.67%)
Mutual labels: hooks
React Native Modalize
A highly customizable modal/bottom sheet that loves scrolling content.
Stars: ✭ 2,119 (+1322.15%)
Mutual labels: component
Tmux Yank
Tmux plugin for copying to system clipboard. Works on OSX, Linux and Cygwin.
Stars: ✭ 1,941 (+1202.68%)
Mutual labels: clipboard
Fluentvalidation.blazor
Fluent Validation-powered Blazor component for validating standard <EditForm> 🌌 ✅
Stars: ✭ 140 (-6.04%)
Mutual labels: component
React Circular Input
React components for easily composing a circular range input
Stars: ✭ 141 (-5.37%)
Mutual labels: hooks
Bekcurvetabbar
Full Customizable Tabbar with IBInspectables
Stars: ✭ 144 (-3.36%)
Mutual labels: component
📋 react-use-clipboard
A React Hook that provides copy to clipboard functionality.
Install
You can install react-use-clipboard
with NPM or Yarn.
npm install react-use-clipboard --save-exact
yarn add react-use-clipboard --exact
We encourage pinning the version number until react-use-clipboard
reaches 1.0.0
. We may ship breaking changes in 0.x.x
versions.
Usage
Here's how to use react-use-clipboard
:
import useClipboard from "react-use-clipboard";
function App() {
const [isCopied, setCopied] = useClipboard("Text to copy");
return (
<button onClick={setCopied}>
Was it copied? {isCopied ? "Yes! 👍" : "Nope! 👎"}
</button>
);
}
You can reset the isCopied
value after a certain amount of time with the successDuration
option.
import useClipboard from "react-use-clipboard";
function App() {
const [isCopied, setCopied] = useClipboard("Text to copy", {
// `isCopied` will go back to `false` after 1000ms.
successDuration: 1000,
});
return (
<button onClick={setCopied}>
Was it copied? {isCopied ? "Yes! 👍" : "Nope! 👎"}
</button>
);
}
This package only works in versions of React that support Hooks.
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].