Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/filipchalupa/react-swipe-action


https://github.com/filipchalupa/react-swipe-action

Last synced: about 14 hours ago
JSON representation

Awesome Lists containing this project

README

        

# React swipe action [![npm](https://img.shields.io/npm/v/react-swipe-action.svg)](https://www.npmjs.com/package/react-swipe-action) ![npm type definitions](https://img.shields.io/npm/types/react-swipe-action.svg)

Swipe to reveal or perform an action. Try interactive [Storybook demo](https://filipchalupa.cz/react-swipe-action/).

## Installation

```bash
npm install react-swipe-action
```

## How to use

```jsx
import { SwipeAction } from 'react-swipe-action'
import 'react-swipe-action/dist/index.css'

const App = () => {
return (
{ alert('Click') }} style={{ position: 'relative' }}>
Button
{handle}
}
endAction={{
content: (
{ alert('Right action') }}
>
Right action

),
onLongSwipe: () => { alert('Right action') },
background:

,
}}
/>
)
}
```