Chart primitives
Layouts & specialized
Interactions
Data utilities
Umbrella package
@vx/drag
@vx/drag provides react components for making items within an interface (or chart) draggable.
Installation
npm install --save @vx/dragExamples
Drag i
<Drag.Drag />>
Drag ii
<Drag.Drag />
Components
APIs
#<Drag />
Height of the drag container.
Width of the drag container.
Whether to render an invisible rect below children to capture the drag area as defined by width and height.
Default true
# Drag.children
string | number | boolean | {} | ReactElement<any, string | ((props: any) => ReactElement<any, string | ... | (new (props: any) => Component<any, any, any>)> | null) | (new (props: any) => Component<...>)> | ... 4 more ... | undefinedoptional Children render function which is passed the state of dragging and callbacks for drag start/end/move.
Optional callback invoked upon drag end.
Optional callback invoked upon drag movement.
Optional callback invoked upon drag start.
Whether to reset drag state upon the start of a new drag.
Default false