react-draggable-playground
Reusable React-draggable components with render props.
Installation
$ yarn add react-draggable-playground
Demo
Usage
; <DraggableParent height=300 width=300> <DraggableItem defaultPosition= x: 100 y: 100 onPositionChange= {} > <div>item</div> </DraggableItem></DraggableParent>;
API
type Position = x: number y: number; // DraggableItemtype Props = ReactNode disabled: boolean onPositionChange?: Promise<void> | void defaultPosition?: Position; // DraggableParenttype Props = height: number width: number children?: ReactNode style?: Object;
Development
Requirements
- node >= 9.8.0
- yarn >= 1.5.1
$ yarn install --pure-lockfile$ yarn start
Test
$ yarn run format$ yarn run eslint$ yarn run flow$ yarn run test:watch$ yarn run build
CONTRIBUTING
- ⇄ Pull requests and ★ Stars are always welcome.
- For bugs and feature requests, please create an issue.
- Pull requests must be accompanied by passing automated tests.