Drag & drop
Organism
A reusable drag-and-drop context: wrap a surface in a DragDropProvider, mark droppable regions with DropZone, and make items draggable with Draggable plus a DragHandle grip.
Playground
Every control sets a real prop of DragDropProviderProps. The JSX below updates as you go.
Web
iOS
Android
JSX ยท DragDropProviderProps
Variants
2 examples from src/organisms/drag-drop/drag-drop.md, each rendered live from its own JSX.
Anatomy
1
Drop zone
2
Draggable
3
Lifted item
4
Drop indicator
Dimmed parts appear only in some states or variants.
Props
3 props on DragDropProviderProps, grouped as they are declared in source. Required props are marked *.
Accessibility and keyboard
Keyboard
Space
Lifts or drops the focused card
Arrow keys
Moves a lifted card
Escape
Cancels the move
Semantics
Roles
button
States
disabled
ARIA on web
aria-disabled
aria-pressed
From the docs
Items lift into a floating ghost and reorder within or across zones, position-aware. It runs on iOS, Android, and the web from one PanResponder + Animated code path, and the grip is keyboard- and screen-reader-operable: press Space to grab, the arrow keys to move, Space to drop, Escape to cancel.
Platform skins
The playground's props on each platform: same tree, native shapes, type and touch sizes.
Usage
Items lift into a floating ghost and reorder within or across zones, position-aware. It runs on iOS, Android, and the web from one PanResponder + Animated code path, and the grip is keyboard- and screen-reader-operable: press Space to grab, the arrow keys to move, Space to drop, Escape to cancel.
The reading direction is respected throughout. In a right-to-left locale a horizontal zone lays its items out right to left, so the first position is the rightmost one, the drop indicator meets the row's right edge, and the two horizontal arrows swap roles (Left Arrow moves forward, Right Arrow back, per the WAI-ARIA practices). Vertical lists and the up/down arrows read the same way in both directions.
Tokens
Read from the playground render. Values follow the scheme and the ion hue.
--fd
--fm
--ft
--ion
--ion-glow
--ion-ring
--ion-soft
--ln
--ln2
--sf
--sh-lg
--tx3