@wobwob/react-swipe-to-delete-ios
v1.0.0
Published
A simple React component to reproduce the way iOS deletes an item in a list. [Demo](https://arnaudambro.github.io/react-swipe-to-delete-ios)
Downloads
3
Maintainers
Readme
react-swipe-to-delete-ios
A simple React component to reproduce the way iOS deletes an item in a list. Demo
Installation
yarn add react-swipe-to-delete-ios
Usage
import React from 'react'
import SwipeToDelete from 'react-swipe-to-delete-ios'
...
<SwipeToDelete
onDelete={handleDelete} // required
height={100} // required
// optional
transitionDuration={250} // default
deleteWidth={75} // default
deleteColor="rgba(252, 58, 48, 1.00)" // default
deleteText="Delete" // default
deleteComponent={<DeleteComponent/>} // not default
disabled={false} // default
rtl={false} // default
>
{children}
</SwipeToDelete>
Props
Prop | Type | Default --- | --- | --- onDelete | function | required height | number | required transitionDuration | number (ms) | 250 deleteWidth | number (px) | 75 deleteColor | string | "rgba(252, 58, 48, 1.00)" deleteText | string | "Delete" (deleteText or deleteComponent) deleteComponent | node | null (deleteText or deleteComponent) disabled | bool | false rtl | bool | false
Todo
- [ ] Tests
- [ ] Browser compatibility check