Copy button
An icon action that copies a value and acknowledges it
Usage
import { useState } from "react";
import { CopyButton } from "@gpuixui/components";
const [mirror, setMirror] = useState("");
<CopyButton text={token} onCopy={setMirror} />;API
| Prop | Type | Default |
|---|---|---|
text | string | — |
onCopy | (text: string) => void | — |
label | string | "Copy" |
copiedLabel | string | "Copied" |
acknowledgeMs | number | 1200 |
size | "sm" | "md" | "lg" | "sm" |
disabled | boolean | false |
color | string | mutedForeground |
level | SurfaceLevel | "fast" |
className | string | — |
style | StateStyle<CopyButtonState> | — |
Edit this page on GitHubpackages/components/docs/copy-button.mdx