# react-interactjs-wrapper

> React wrapper for interact.js

Latest version **0.1.7** (published 2018-01-31) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-interactjs-wrapper
pnpm add react-interactjs-wrapper
yarn add react-interactjs-wrapper
bun add react-interactjs-wrapper
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.7 |
| Published | 2018-01-31 |
| First published | 2018-01-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=7.7.4 |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | VictorParraCant |
| Maintainers | victor-parracant |
| Keywords | react, interact, draggable, resizable |

## Links

- npm: https://www.npmjs.com/package/react-interactjs-wrapper
- Repository: https://github.com/VictorParraCant/react-interactjs-wrapper
- Homepage: https://github.com/VictorParraCant/react-interactjs-wrapper#readme
- Issues: https://github.com/VictorParraCant/react-interactjs-wrapper/issues
- npm.io page: https://npm.io/package/react-interactjs-wrapper

## Dependencies (1)

- [interact.js](https://npm.io/package/interact.js.md) ^1.2.6

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.1.7 (latest) — 2018-01-31
- 0.1.6 — 2018-01-31
- 0.1.5 — 2018-01-30
- 0.1.4 — 2018-01-30
- 0.1.3 — 2018-01-30
- 0.1.2 — 2018-01-30
- 0.1.1 — 2018-01-30
- 0.1.0 — 2018-01-30

## README

# react-interactjs-wrapper

[![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url]

## Install:
```
npm install react-interactjs-wrapper --save
```

## Props:

|Props| Type | Description
|---|---|----|
| _draggable_ | Bool | Is the child object supposed to be draggable? |
| _draggableOptions_ | Object | Options to pass to the draggable method |
| _resizable_ | Bool | Is the child object supposed to be resizable? |
| _resizableOptions_ | Object | Options to pass to the resizable method |

## Example:
```
import React from 'react'
import { render } from 'react-dom'
import InteractWrapper from 'react-interactjs-wrapper'

const draggableOptions = {
     onmove: event => {
        const target = event.target
      // keep the dragged position in the data-x/data-y attributes
      const x = (parseFloat(target.getAttribute('data-x')) || 0) + event.dx
      const y = (parseFloat(target.getAttribute('data-y')) || 0) + event.dy

      // translate the element
      target.style.webkitTransform =
      target.style.transform =
        'translate(' + x + 'px, ' + y + 'px)'

      // update the posiion attributes
      target.setAttribute('data-x', x);
      target.setAttribute('data-y', y);
    }
}

const example = (
    <InteractWrapper draggable draggableOptions={draggableOptions}>
        <img src="https://pbs.twimg.com/profile_images/526421493731717120/INda0NaM.png" height={100} width={100}/>
    </InteractWrapper>
)

render(example, document.getElementById('container'));
```

---

## License:

[MIT](https://github.com/VictorParraCant/react-interactjs-wrapper/blob/master/LICENSE)


[npm-image]: https://badge.fury.io/js/react-interactjs-wrapper.svg
[npm-url]: https://badge.fury.io/js/react-interactjs-wrapper
[travis-image]: https://travis-ci.org/VictorParraCant/react-interactjs-wrapper.svg?branch=master
[travis-url]: https://travis-ci.org/VictorParraCant/react-interactjs-wrapper

---
_Source: https://npm.io/package/react-interactjs-wrapper · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
