Have ideas to improve npm?Join in the discussion! »

    dnd-core
    TypeScript icon, indicating that this package has built-in type declarations

    14.0.0 • Public • Published

    npm package Build Status Test Coverage

    dnd-core

    Drag and Drop stateful engine - no GUI.

    This is a clean implementation of drag and drop primitives that does not depend on the browser. It powers React DnD internally.

    Wat?

    To give you a better idea:

    • There is no DOM here
    • We let you define drop target and drag source logic
    • We let you supply custom underlying implementations (console, DOM via jQuery, React, React Native, whatever)
    • We manage drag source and drop target interaction

    This was written to support some rather complicated scenarios that were too hard to implement in React DnD due to its current architecture:

    As it turns out, these problems are much easier to solve when DOM is thrown out of the window.

    What's the API like?

    Tests should give you some idea. You register drag sources and drop targets, connect a backend (you can use barebones TestBackend or implement a fancy real one yourself), and your drag sources and drop targets magically begin to interact.

    Keywords

    none

    Install

    npm i dnd-core

    DownloadsWeekly Downloads

    893,818

    Version

    14.0.0

    License

    MIT

    Unpacked Size

    174 kB

    Total Files

    144

    Last publish

    Collaborators

    • avatar
    • avatar
    • avatar
    • avatar
    • avatar