1.0.3 • Published 5 years ago

@lampn9397/react-textbook-matching v1.0.3

Weekly downloads
1
License
-
Repository
-
Last release
5 years ago

@lampn9397/react-textbook-matching

NPM version License

Installation

yarn add @lampn9397/react-textbook-matching

Or

npm install @lampn9397/react-textbook-matching

Usage

import { DraggableItem, DroppableZone } from "@lampn9397/react-textbook-matching";

<DraggableItem
  // Item data
  item={{}}
  // DroppableZone rect
  droppableZone={{
    x: 0,
    y: 0,
    width: 0,
    height: 0,
  }}
  
  onDragStop={({ isInDroppableZone }) => { }}
/>

// Ref for calculate DroppableZone rect
const droppableZoneRef = React.useRef();
// For calculate DroppableItem in zone
const badgeNumber = 0;
<DroppableZone ref={droppableZoneRef} badgeNumber={badgeNumber} />

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT