1.0.0 • Published 5 years ago

react-native-easy-action-sheet v1.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

react-native-easy-action-sheet

npm npm npm npm

ScreenShots

Installation

  • npm: npm install react-native-easy-action-sheet --save
  • Yarn: yarn add react-native-easy-action-sheet

Example

import { Header } from 'react-navigation'
import { Header } from 'react-navigation-stack' (4.x)
import ActionSheet from 'react-native-easy-action-sheet'
class Demo extends React.Component {
  showActionSheet = () => {
    this.ActionSheet.show()
  }
  render() {
    return (
      <View>
        <Text onPress={this.showActionSheet}>Open ActionSheet</Text>
        <ActionSheet
          androidHeaderHeight={Header.HEIGHT}
          ref={e => this.ActionSheet = e}
          title={'Which one do you like ?'}
          options={['Apple', 'Banana', 'cancel']}
          cancelButtonIndex={2}
          destructiveButtonIndex={1}
          onPress={(index) => { /* do something */ }}
        />
      </View>
    )
  }
}

Props

propstypedefaultInfo
optionsstringundefineda list of button titles (required)
cancelButtonIndexnumber0index of cancel button in options
destructiveButtonIndexnumberundefinedindex of destructive button in options
titlestringundefineda list of button titles (required)
messagestringundefineda message to show below the title
tintColorstringthe color used for non-destructive button titles
onPressfunc(index) => console.log(index)button on press
androidHeaderHeightnumberundefinedheight of navHeader on android (required)