Skip to content

Commit 45dcfcb

Browse files
author
Claudéric Demers
authored
Update README.md
1 parent c202e4e commit 45dcfcb

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,9 @@ That's it! React Sortable does not come with any styles by default, since it's m
8686

8787
More code examples are available [here](https://github.com/clauderic/react-sortable-hoc/blob/master/examples/).
8888

89-
### Running Examples
90-
91-
In root folder:
92-
93-
```
94-
$ npm install
95-
$ npm run storybook
96-
```
89+
Why should I use this?
90+
--------------------
91+
There are already a number of great Drag & Drop libraries out there (for instance, [react-dnd](https://github.com/gaearon/react-dnd/) is fantastic). If those libraries fit your needs, you should definitely give them a try first. However, most of those libraries rely on the HTML5 Drag & Drop API, which has some severe limitations. For instance, things rapidly become tricky if you need to support touch devices, if you need to lock dragging to an axis, or want to animate the nodes as they're being sorted. React Sortable HOC aims to provide a simple set of higher-order components to fill those gaps. If you're looking for a dead-simple, mobile-friendly way to add sortable functionality to your lists, then you're in the right place.
9792

9893
### Prop Types
9994

@@ -128,12 +123,17 @@ Examples: `10` (which is the same as `"10px"`), `"50%"`
128123
| collection | Number or String | `0` | | The collection the element is part of. This is useful if you have multiple groups of sortable elements within the same `SortableContainer`. [Example](http://clauderic.github.io/react-sortable-hoc/#/basic-configuration/multiple-lists) |
129124
| disabled | Boolean | `false` | | Whether the element should be sortable or not |
130125

131-
Why should I use this?
132-
--------------------
133-
There are already a number of great Drag & Drop libraries out there (for instance, [react-dnd](https://github.com/gaearon/react-dnd/) is fantastic). If those libraries fit your needs, you should definitely give them a try first. However, most of those libraries rely on the HTML5 Drag & Drop API, which has some severe limitations. For instance, things rapidly become tricky if you need to support touch devices, if you need to lock dragging to an axis, or want to animate the nodes as they're being sorted. React Sortable HOC aims to provide a simple set of higher-order components to fill those gaps. If you're looking for a dead-simple, mobile-friendly way to add sortable functionality to your lists, then you're in the right place.
134-
135126
FAQ
136127
---------------
128+
### Running Examples
129+
130+
In root folder:
131+
132+
```
133+
$ npm install
134+
$ npm run storybook
135+
```
136+
137137
### Grid support
138138
Need to sort items in a grid? We've got you covered! Just set the `axis` prop to `xy`. Grid support is currently limited to a setup where all the cells in the grid have the same width and height, though we're working hard to get variable width support in the near future.
139139

0 commit comments

Comments
 (0)