New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-easy-sort

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-easy-sort - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

2

package.json
{
"name": "react-easy-sort",
"version": "0.1.0",
"version": "0.1.1",
"description": "A React component to sort items in lists or grids",

@@ -5,0 +5,0 @@ "homepage": "https://ricardo-ch.github.io/react-easy-sort/",

@@ -5,2 +5,12 @@ # react-easy-sort

![react-easy-sort-demo](https://user-images.githubusercontent.com/2678610/107036435-f27fbb00-67b9-11eb-8e3f-72a000586d35.gif)
The goal of this component is to allow sorting elements with drag and drop.
It is mobile friendly by default. It doesn't block scrolling the page when swiping inside it:
the user needs to press an item during at least 200ms to start the drag gesture.
On non-touch device, the drag gesture only starts after moving an element by at least one pixel.
This is done to avoid blocking clicks on clickable elements inside an item.
## Features

@@ -13,2 +23,11 @@

## Demo
Check out the examples:
- [Example with grid layout](https://codesandbox.io/s/react-easy-sort-grid-demo-87ev9)
- [Example with vertical list layout](https://codesandbox.io/s/react-easy-sort-vertical-list-demo-njg4i)
- [Example with horizontal list layout](https://codesandbox.io/s/react-easy-sort-horizontal-list-demo-69b3k)
- [Interactive avatars demo](https://codesandbox.io/s/react-easy-sort-images-demo-486qk)
## Installation

@@ -51,2 +70,15 @@

## Props
### SortableList
| Name | Description | Type | Default |
| ------------------------ | :----------------------------------------------: | :--------------------------------------------: | ------: |
| **onSortEnd\*** | Called when the user finishes a sorting gesture. | `(oldIndex: number, newIndex: number) => void` | - |
| **draggedItemClassName** | Class applied to the item being dragged | `string` | - |
### SortableItem
This component doesn't take any other props than its child. This child should be a single React element that can receives a ref. If you pass a component as a child, it needs to be wrapped with `React.forwardRef()`.
## Development

@@ -53,0 +85,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc