Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/filipchalupa/react-swipe-action
https://github.com/filipchalupa/react-swipe-action
Last synced: about 14 hours ago
JSON representation
- Host: GitHub
- URL: https://github.com/filipchalupa/react-swipe-action
- Owner: FilipChalupa
- Created: 2024-08-20T13:26:05.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2024-10-01T14:36:27.000Z (about 1 month ago)
- Last Synced: 2024-11-05T13:56:42.680Z (2 days ago)
- Language: TypeScript
- Size: 283 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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:
}}
/>
)
}
```