Carregando…
Carregando…
Carregando…One-click copy button with success feedback, 3 variants and configurable timeout.
$ npx kikitocn add copy-button@/lib/utilsimport { CopyButton } from "@/components/ui/cn/copy-button/CopyButton";
export function CopyButtonExample() {
return (
<CopyButton value="npx kikitocn add button" />
);
}| Prop | Tipo | Padrão | Descrição |
|---|---|---|---|
text* | string | — | Texto a ser copiado para a área de transferência |
label | string | 'Copy' | Texto do botão antes de copiar |
successLabel | string | 'Copied!' | Texto exibido após cópia bem-sucedida |
size | 'sm' | 'md' | 'lg' | 'md' | Tamanho do botão |
variant | 'outline' | 'ghost' | 'solid' | 'outline' | Estilo visual do botão |
timeout | number | 2000 | Duração (ms) do estado de sucesso |
onCopy | () => void | undefined | Callback chamado após a cópia |
Variants
Sizes