# Pragmatic drag and drop

> Atlassian's tiny, framework-agnostic drag-and-drop built on the native HTML5 DnD API (powers Trello and Jira).

Source: https://tastebase.ehsanulsiam.workers.dev/browse/pragmatic-drag-and-drop

free

Atlassian's tiny, framework-agnostic drag-and-drop built on the native HTML5 DnD API (powers Trello and Jira).

by Atlassian (Alex Reardon)[GitHub](https://github.com/atlassian/pragmatic-drag-and-drop)[npm](https://npmjs.com/package/@atlaskit/pragmatic-drag-and-drop)

[visit](https://atlassian.design/components/pragmatic-drag-and-drop/?utm_source=tastebase&utm_medium=referral&utm_content=detail-page)

[https://atlassian.design/components/pragmatic-drag-and-drop/](https://atlassian.design/components/pragmatic-drag-and-drop/?utm_source=tastebase&utm_medium=referral&utm_content=detail-preview)

## Try these

no preview

### [dnd-kit](https://tastebase.ehsanulsiam.workers.dev/browse/dnd-kit)

Accessible drag-and-drop toolkit for React: sortable lists, kanban boards, keyboard dragging.

no preview

### [FormKit Drag and Drop](https://tastebase.ehsanulsiam.workers.dev/browse/formkit-drag-and-drop)

Data-first sortable lists in about 4 KB: your array is the source of truth and reorders as you drag.

no preview

### [Sonner](https://tastebase.ehsanulsiam.workers.dev/browse/sonner)

Opinionated toast component with stacking, swipe to dismiss and promise toasts; ports for Vue, Svelte, Solid and Angular.

no preview

### [react-hot-toast](https://tastebase.ehsanulsiam.workers.dev/browse/react-hot-toast)

Lightweight toast library for React with a headless useToaster hook for fully custom UI.

## Looks that pick it

[macOS desktop](https://tastebase.ehsanulsiam.workers.dev/looks/macos-desktop)

## For your agent

##### Install

`npm i @atlaskit/pragmatic-drag-and-drop`

##### Use it for

- a Trello-style board with many columns and hundreds of cards
- dragging between windows, iframes or into the app from the desktop (files, links)
- tree views and nested lists in a large product where bundle size per feature matters

##### Skip it when

- dragging a divider to resize split panes or panels: the kit's Resizable part (react-resizable-panels under shadcn/ui)
- you need keyboard dragging out of the box: use dnd-kit (Pragmatic expects an action-menu alternative)
- a small sortable list: dnd-kit or formkit-drag-and-drop need far less setup
- smooth drag previews that follow the finger with spring physics on touch: native DnD previews are static; use dnd-kit with motion

##### What's inside18 free

- Element adapter (draggable, dropTargetForElements, monitorForElements)
- External adapter (files, text, URLs)
- Text selection adapter
- Drop targets
- Monitors
- Events
- combine
- once
- reorder
- preventUnhandled
- Auto scroll
- Hitbox (closest edge, tree item)
- Flourish
- Live region
- React accessibility
- React drop indicator
- react-beautiful-dnd migration
- Unit testing

##### Facts

**Frameworks**
react, vue, svelte, solid, angular, vanilla

**Styling**
unstyled

**Weight**
small

**Accessibility**
weak

**Maturity**
established

**License**
Apache-2.0

**Price**
Free

##### Alternatives

[dnd-kit](https://tastebase.ehsanulsiam.workers.dev/browse/dnd-kit)[FormKit Drag and Drop](https://tastebase.ehsanulsiam.workers.dev/browse/formkit-drag-and-drop)

[Compare Pragmatic drag and drop with its alternatives](https://tastebase.ehsanulsiam.workers.dev/alternatives/pragmatic-drag-and-drop-alternatives)

```
import { draggable, dropTargetForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter'

useEffect(() => draggable({ element: cardRef.current!, getInitialData: () => ({ id }) }), [id])

useEffect(
  () => dropTargetForElements({ element: columnRef.current!, onDrop: ({ source }) => moveCard(source.data.id) }),
  [],
)
```

https://atlassian.design/components/pragmatic-drag-and-drop/examples

Loading website

[Visit](https://atlassian.design/components/pragmatic-drag-and-drop/?utm_source=tastebase&utm_medium=referral&utm_content=floating-pill)
