# react-jquery-sortable

> React wrapper for jQuery sortable

Latest version **0.1.0-alpha.5** (published 2016-12-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-jquery-sortable
pnpm add react-jquery-sortable
yarn add react-jquery-sortable
bun add react-jquery-sortable
```

## 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.0-alpha.5 |
| Published | 2016-12-20 |
| First published | 2016-12-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | mking-clari |
| Keywords | jquery, jquery-ui, react, react-component, sortable |

## Links

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

## 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.0-alpha.5 (latest) — 2016-12-20
- 0.1.0-alpha.4 — 2016-12-20
- 0.1.0-alpha.3 — 2016-12-20
- 0.1.0-alpha.2 — 2016-12-20
- 0.1.0-alpha.1 — 2016-12-20

## README

react-jquery-sortable
===
[Demo](http://codepen.io/mking-clari/pen/pNYjJp)

Usage
---

1. Include jQuery and jQuery UI globally (this is required because of a jQuery UI limitation)
2. Configure webpack to support `import '$' from 'jquery'` (see `externals` in `webpack.config.common.js`)
3. Create the `Sortable` (see `Example.jsx`).

Code Example
---
```javascript
import Sortable from 'react-jquery-sortable';
import Widget from './Widget';

function Example({ onChange, widgets, ...props }) {
  // - Sortable options are passed as props
  // - When an item is dropped, onChange is called with a list of ids that represents the new order
  // - Each child must have an id. The id is used to identify the order of the children.

  return (
    <Sortable
      forcePlaceholderSize
      handle=".handle"
      onChange={order => onChange(order)}
      placeholder="placeholder"
      {...props}
    >
      {widgets.map(widget => (
        <Widget
          handleClassName=".handle"
          id={widget.get('id')}
          key={widget.get('id')}
          widget={widget}
        />
      ))}
    </Sortable>
  );
}
```

Setup
---
```
yarn
yarn start
# Visit http://localhost:8080
```

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