1.0.1 • Published 8 years ago

rc-swipeout-limited v1.0.1

Weekly downloads
3
License
-
Repository
github
Last release
8 years ago

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

Usage

import Swipeout from 'rc-swipeout';
import 'rc-swipeout/assets/index.less';

<Swipeout
  left={[
    {
      text: 'reply',
      onPress:() => console.log('reply'),
      style: { backgroundColor: 'orange', color: 'white' }
    }
  ]}
  right={[
    {
      text: 'delete',
      onPress:() => console.log('delete'),
      style: { backgroundColor: 'red', color: 'white' }
    }
  ]}
  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() {}

Test Case

npm test
npm run chrome-test

Coverage

npm run coverage

open coverage/ dir

License

rc-swipeout is released under the MIT license.