Overview
A paste zone that accepts files from the clipboard. Click to focus, then paste with Cmd+V (or Ctrl+V). Great for quick screenshot uploads.
Installation
npx shadcn@latest add @elements/uploadthing-pasteUsage
import { UploadThingPaste } from "@/components/elements/uploadthing/uploadthing-paste";
export function PasteUploader() {
return (
<UploadThingPaste
onPaste={(files) => console.log("Pasted:", files)}
accept={["image/*"]}
>
<p>Click and paste an image (Cmd+V)</p>
</UploadThingPaste>
);
}Props
| Prop | Type | Default | Description |
|---|---|---|---|
onPaste | (files: File[]) => void | - | Called when files are pasted |
onUpload | (files: File[]) => void | - | Called to trigger upload |
accept | string[] | ["image/*"] | Accepted MIME types |
disabled | boolean | false | Disable paste |
children | ReactNode | - | Custom content |
className | string | - | Additional CSS classes |
Features
- Focus indicator ring
- Keyboard shortcut hint (Cmd+V / Ctrl+V)
- Custom content via children
- MIME type filtering
- Disabled state support