Socket
Socket
Sign inDemoInstall

rc-swipeout

Package Overview
Dependencies
16
Maintainers
3
Versions
54
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    rc-swipeout

swipe out ui component for react(web and react-native)


Version published
Weekly downloads
19K
increased by4.71%
Maintainers
3
Install size
5.62 MB
Created
Weekly downloads
 

Readme

Source

rc-swipeout


iOS-style swipeout buttons that appear from behind a component (web & react-native support)

NPM version build status Test coverage

Screenshots

rc-swipeout

Installation

npm install --save rc-swipeout

Development

web:
npm install
npm start

rn:
tnpm run rn-start

Example

react-native

./node_modules/rc-tools run react-native-init
react-native run-ios

Usage

import Swipeout from 'rc-swipeout';
import 'rc-swipeout/assets/index.less'; (web only)

<Swipeout
  left={[
    {
      text: 'reply',
      onPress:() => console.log('reply'),
      style: { backgroundColor: 'orange', color: 'white' },
      className: 'custom-class-1'
    }
  ]}
  right={[
    {
      text: 'delete',
      onPress:() => console.log('delete'),
      style: { backgroundColor: 'red', color: 'white' },
      className: 'custom-class-2'
    }
  ]}
  onOpen={() => console.log('open')}
  onClose={() => console.log('close')}
>
  <div style={{height: 44}}> swipeout demo </div>
</Swipeout>

API

props

namedescriptiontypedefault
prefixClsclassName prefixStringrc-swipeout
styleswipeout styleObject``
leftswipeout buttons on leftArray[]
rightswipeout buttons on rightArray[]
autoCloseauto close on button pressBooleanfunction() {}
onOpenFunctionfunction() {}
onCloseFunctionfunction() {}
disableddisabled swipeoutBooleanfalse

button props

namedescriptiontypedefault
textbutton textStringClick
stylebutton styleObject``
onPressbutton press functionFunctionfunction() {}
classNamebutton custom classString``

Test Case

npm test
npm run chrome-test

Coverage

npm run coverage

open coverage/ dir

License

rc-swipeout is released under the MIT license.

Keywords

FAQs

Last updated on 12 Jun 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc