# InputCopy

Copy a value with animated success and failure feedback.

> For the complete documentation index, see [llms.txt](/llms.txt). Markdown variants are available by appending `.md` to any URL or sending an `Accept: text/markdown` header. An agent skill is available at [/.well-known/agent-skills/site-skill.md](/.well-known/agent-skills/site-skill.md).





## Preview [#preview]

<ComponentPreview src="examples/components/input-copy.tsx">
  <InputCopyDemo />
</ComponentPreview>

## Installation [#installation]

<CodeBlockCommand __npm__="`npx shadcn@latest add ${SITE.URL}/r/input-copy.json`" __pnpm__="`pnpm dlx shadcn@latest add ${SITE.URL}/r/input-copy.json`" __yarn__="`yarn dlx shadcn@latest add ${SITE.URL}/r/input-copy.json`" __bun__="`bunx shadcn@latest add ${SITE.URL}/r/input-copy.json`" />

## Usage [#usage]

```tsx
import { InputCopy } from "@/components/ui/input-copy";

<InputCopy value="https://example.com" label="Share link" variant="button" />;
```

## API Reference [#api-reference]

`value`: required string. `label`: optional text. `variant`: icon (default) or button. `align`: right (default) or left. `size`: default or compact. `disabled`: disables copying. `onCopy`: called only after a successful copy. Success resets after two seconds. Clipboard failures are announced and can be retried.
