[drag-engine] Add drag and drop primitives - #5487
Open
flaviendelangle wants to merge 146 commits into
Open
flaviendelangle wants to merge 146 commits into
flaviendelangle wants to merge 146 commits into
Conversation
flaviendelangle
requested review from
aarongarciah,
atomiks,
colmtuite,
jjenzz,
michaldudak and
romgrk
as code owners
August 13, 2026 12:57
commit: |
✅ Deploy Preview for base-ui ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Bundle size
PerformanceTotal duration: 1,350.11 ms +38.65 ms(+2.9%) | Renders: 76 (+0) | Paint: 2,261.56 ms +68.02 ms(+3.1%)
14 tests within noise — details Metric alarms
Check out the code infra dashboard for more information about this PR. |
Member
Author
Restructure the Draggable page to match the other Base UI pages: usage guidelines, anatomy, concept sections (kinds and payloads, drag events, drop targets, auto-scrolling, testing), examples, then the API reference. Rewrite the prose without engine jargon and tighten the JSDoc that feeds the reference tables. Replace the dashboard demos' move form with an Alt+Arrow shortcut, drop demos that duplicate the page hero, style the example forms, and use primitive or memoized payloads everywhere. Move the five large examples to the drag-engine experiments with their tests. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Rebuild the draggable tabs experiment on the workspace UI of the former docs example, keeping its four variants, and drop the duplicate tabs, free dragging, and week scheduler experiments whose features the figma board and calendar already cover. Name the two kanban experiments after their drop feedback: placeholder card versus line indicator. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Merge the content components into the default exports, inline the scrolling board's viewport, shorten the canvas camera update, drop trackDragOver from the axis demo, and share one ref-callback helper in the manager demo. Add focus markers so each collapsed code block opens on the lines the demo is about instead of the imports. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Global keys are shared by the page, so the docs ask callers to prefix them, but the function no longer throws: collision risk is the caller's responsibility. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This reverts commit 51c0478.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Documentation
Feature comparison with dnd kit, React Aria, and Pragmatic drag and drop
Summary
Adds unstyled drag-and-drop components and hooks under the
Draggablenamespace, with mouse, touch, and pen support:Draggable.Providersupplies a default kind for simple interactions and the React context boundary for custom previews.Draggable.Rootcreates a drag source. AddDraggable.Handleto limit where a drag starts.Draggable.Targetaccepts drops and exposes target coordinates and snapping helpers.Draggable.Previewconfigures the default source clone or renders custom preview content.Draggable.CollisionProviderresolves insertion positions for sorting. Applications control the order and can update it on drop or while dragging.Draggable.Viewportenables auto-scroll for a container or implements custom scrolling.Draggable.useDragMonitorobserves drag events,Draggable.useActiveDragreads the active source, andDraggable.useDragDropManagerprovides imperative registration and cancellation.Basic usage
Simple interactions need no explicit kind or payload. Sources and targets share their provider's default kind:
For typed data, share a kind between the source and target. Drop handlers infer
source.payloadfromaccept:Use
getPayloadto derive data at pickup. Explicit shared kinds also allow interactions across providers; the drag manager remains page-wide.Activation thresholds, movement modifiers, data attributes, and CSS variables control drag behavior and styling. Auto-scroll is opt-in for each container through
Draggable.Viewportor imperative registration, including separate registration for page scrolling.Dragging is pointer-driven. Applications provide equivalent keyboard and click or tap actions through move menus, buttons, or shortcuts. The documentation includes accessibility guidance and sorting examples with keyboard shortcuts.