Docs
Copy-to-clipboard
Copy-to-clipboard
Component that wraps any children with copy to clipboard functionality and a tooltip.
Installation
pnpm dlx shadcn@latest add "https://akasha-ui.pages.dev/r/styles/default/copy-to-clipboard.json"
Usage
import { CopyToClipboard } from "<path-to-ui-components>/copy-to-clipboard";
<CopyToClipboard
textToCopy="0x8a022905463998860516390fb27548479a098b95"
ctaText="Copy address"
successText="Copied ✓"
>
<p>Click here to copy</p>
</CopyToClipboard>
Props
Name | Type | Description |
---|---|---|
textToCopy | string | Text to copy. |
ctaText | string | Call to action text. |
successText | string | Success message to display once text is copied. |
resetDuration | number | Duration in milliseconds before success message is reset. |
The default value of resetDuration
is 5000 milliseconds.