0.0.1-alpha.1 • Published 6 years ago

tbd-dnd v0.0.1-alpha.1

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

tbd-dnd

The library was presented at ReactiveConf 2018, check it out!

I'd like to point out, that this library might be great help when building complex animated UIs. If you need simple things like sorted lists, I recommend you to use one of these instead:

Also, this project is in very early stage of development and the API will most likely change a lot. Main purpose is to demonstrate our use-case and gather feedback, if you wanna achieve something similar. If so, say hi at vojta@productboard.com / twitter.com/vojta_prikryl

Docs

Coming soon.

DraggableCanvas

PropTypeDescription
getWrapperEl?() => MaybeTODO
detectScrollEvents?booleanTODO
detectEdgeDragging?booleanTODO
onEdgeDragging?(delta: Coordinates) => voidTODO
onElementDragStart?(id: Id, ev: MouseEvent) => voidTODO
onElementDrag?(id: Id, x: number, y: number) => voidTODO
onElementDrop?(id: Id) => voidTODO
onElementDropAnimationEnd?(id: Id) => voidTODO
children(params: ChildrenFunctionParams) => React.ReactNodeTODO

DraggableCanvasElement

PropTypeDescription
xnumberTODO
ynumberTODO
forbidDragging?booleanTODO
isDragged?booleanTODO
onDragStart?(ev: MouseEvent) => voidTODO
onDrag?(x: number, y: number) => voidTODO
onDrop?() => voidTODO
preventClickEventAfterDrag?booleanTODO
childrenReact.ReactNodeTODO

Example

Basic example demonstrating how to user DraggableCanvasElement and DraggableCanvas API: https://codepen.io/aldredcz/project/editor/ZnNMVg

Preview (click for full version)

Preview