react-swipe-action
TypeScript icon, indicating that this package has built-in type declarations

0.0.3 • Public • Published

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' }} />,
			}}
		/>
	)
}

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.0.374latest

Version History

VersionDownloads (Last 7 Days)Published
0.0.374
0.0.20
0.0.10

Package Sidebar

Install

npm i react-swipe-action

Weekly Downloads

74

Version

0.0.3

License

ISC

Unpacked Size

18 kB

Total Files

14

Last publish

Collaborators

  • onset