0.0.3 • Published 9 months ago

react-swipe-action v0.0.3

Weekly downloads
-
License
ISC
Repository
github
Last release
9 months ago

React swipe action npm npm type definitions

Swipe to reveal or perform an action. Try interactive Storybook demo.

Installation

npm install react-swipe-action

How to use

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

const App = () => {
	return (
		<SwipeAction
			main={(handle) => <button onClick={() => { alert('Click') }} style={{ position: 'relative' }}>
				Button
				{handle}
			</button>}
			endAction={{
				content: (
					<button
						type="button"
						onClick={() => { alert('Right action') }}
					>
						Right action
					</button>
				),
				onLongSwipe: () => { alert('Right action') },
				background: <div style={{ backgroundColor: 'red' }} />,
			}}
		/>
	)
}
0.0.3

9 months ago

0.0.2

11 months ago

0.0.1

11 months ago