shadcn-ahooks

useDrag

A pair of hooks to help you manage data transfer between drag and drop

Overview

A pair of hooks to help you manage data transfer between drag and drop

Documentation and Examples

Installation

Open in
pnpm dlx shadcn@latest add https://shadcn-ahooks.vercel.app/r/useDrag.json
npx shadcn@latest add https://shadcn-ahooks.vercel.app/r/useDrag.json
yarn shadcn@latest add https://shadcn-ahooks.vercel.app/r/useDrag.json
bun shadcn@latest add https://shadcn-ahooks.vercel.app/r/useDrag.json

A pair of hooks to help you manage data transfer between drag and drop

useDrag can be used alone to accept file, text or uri dropping.

useDrag should be used along with useDrag.

Paste into the drop area will also be treated as content drop.

On this page