1.1.1 • Published 8 years ago

react-swipeout v1.1.1

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

react-swipeout


iOS-style swipeout buttons that appear from behind a component

NPM version build status Test coverage

Screenshots

swipeout

Installation

npm install --save react-swipeout

Development

npm install
npm start

Example

Usage

import Swipeout from 'Swipeout';

<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

属性说明类型默认值
prefixClsclassName prefixStringrc-swipeout
styleswipeout styleObject
leftswipeout buttons on leftArraynull
rightswipeout buttons on rightArraynull
autoCloseauto close on button pressBooleanfunction() {}
onOpenFunctionfunction() {}
onCloseFunctionfunction() {}
disableddisabled swipeoutBooleanfalse

button props

属性说明类型默认值
textbutton textStringClick
stylebutton styleObject
onPressbutton press functionFunctionfunction() {}

Test Case

npm test
npm run chrome-test

Coverage

npm run coverage

open coverage/ dir

License

react-swipeout is released under the MIT license.

1.1.1

8 years ago

1.1.0

8 years ago

1.0.0

8 years ago