# draggable-react

> React components for Shopify's draggable

Latest version **1.0.0-beta.12** (published 2017-11-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install draggable-react
pnpm add draggable-react
yarn add draggable-react
bun add draggable-react
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0-beta.12 |
| Published | 2017-11-19 |
| First published | 2017-11-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Tzvi Melamed |
| Maintainers | tzvipm |

## Links

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

## Dependencies (3)

- [uuid](https://npm.io/package/uuid.md) ^3.1.0
- [prop-types](https://npm.io/package/prop-types.md) ^15.6.0
- [@shopify/draggable](https://npm.io/package/@shopify/draggable.md) ^1.0.0-beta.3

## Recent versions

- 1.0.0-beta.12 (latest) — 2017-11-19
- 1.0.0-beta.11 — 2017-11-19
- 1.0.0-beta.10 — 2017-11-18
- 1.0.0-beta.9 — 2017-11-18
- 1.0.0-beta.8 — 2017-11-18
- 1.0.0-beta.7 — 2017-11-18
- 1.0.0-beta.6 — 2017-11-18
- 1.0.0-beta.5 — 2017-11-18
- 1.0.0-beta.4 — 2017-11-18
- 1.0.0-beta.3 — 2017-11-18
- 1.0.0-beta.2 — 2017-11-18
- 1.0.0-beta.1 — 2017-11-18
- 1.0.3 — 2017-11-18
- 1.0.2 — 2017-11-18
- 1.0.1 — 2017-11-18
- … 1 more at https://npm.io/package/draggable-react/versions

## README

# draggable-react
> React components for Shopify's draggable

## Table of Contents

  - [Installation](#installation)
  - [Usage](#usage)
  - [Contribute](#contribute)
  - [License](#license)
  - [Changelog](http://github.com/Omniroot/draggable-react/blob/master/CHANGELOG.md)

## Installation

```bash
$ yarn add draggable-react
```

## Usage

This library is still a work in progress. Currently, we expose 3 APIs:
1. A `DraggableProvider` component
2. A `DraggableContainer` component
3. A `withDraggable` higher-order component

### Basic example
To start off, we can use the `containerized` variant of the `DraggableProvider`,
which automatically creates a default `DraggableContainer` around our app.
Simply replace your main `<App />` component with some thing like this:

```jsx
<DraggableProvider containerized>
  <App />
</DraggableProvider> 
```

Next, wrap whichever components you wish to make draggable with the HOC,
then consume the `draggable` prop and use its `className`. For example:

```jsx
const DraggableDiv = withDraggable()(({draggable, children}) => (
  <div className={draggable.className}>
    {children}
  </div>
));
```

If you want the supplied prop to have a name other than `draggable`, you can specify that in the options. For example:

```jsx
const DraggableDiv = withDraggable({prop: 'drag'})(({drag, children}) => (
  <div className={drag.className}>
    {children}
  </div>
));
```

## Contribute

Check out our [Contributing Guidelines](http://github.com/Omniroot/draggable-react/blob/master/CONTRIBUTING.md)

## License

MIT, see [LICENSE.md](http://github.com/Omniroot/draggable-react/blob/master/LICENSE.md) for details.

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