1.0.0 • Published 4 years ago

rn-easy-action-sheet v1.0.0

Weekly downloads
-
License
MIT
Repository
bitbucket
Last release
4 years ago

rn-easy-action-sheet

NPM version License MIT

Action sheet component for react native, it works on iOS and Android.

Content

Installation

  • 1.Run npm i rn-easy-action-sheet --save OR yarn add rn-easy-action-sheet
  • 2.import ActionSheet from 'rn-easy-action-sheet'

Getting started

Add rn-easy-action-sheet to your js file.

import ActionSheet from 'rn-easy-action-sheet'

Inside your component's render method, use CheckBox:

const Data = [
    {
      title: 'Happy',
      icon: <Image source={Happy} style={{
        width: 30,
        height: 30,
        marginRight: 10
      }} />,
      CallBackFn: (data) => {
        console.log("====== Return title =======",data)
      }
    },
    {
      title: 'Good',
      icon: <Image source={Good} style={{
        width: 30,
        height: 30,
        marginRight: 10
      }} />,
      CallBackFn: (data) => {
        console.log("===== Return title ========",data)
      }
    },
    {
      title: 'Joy',
      icon: <Icon name="iconName"  style={{
        width: 30,
        height: 30,
        marginRight: 10
      }} />,
      CallBackFn: (data) => {
        console.log("===== Return title =======",data)
      }
    },
    {
      title: 'Drank',
      icon: <Image source={Drank} style={{
        width: 30,
        height: 30,
        marginRight: 10
      }} />,
      CallBackFn: (data) => {
        console.log("==== Return title ========",data)
      }
    },
  ];

<ActionSheet
            toggle={() => setOpenActionSheet(!openActionSheet)}
            data={Data}
            modalVisible={openActionSheet}
            darkMode={true}

            cancelButtonName="Done"
            CancelButtonStyle={{
              color: 'red'
            }}
          />

Then you can use it like this:

More Usage:

GitHubPopular

API

PropsTypeOptionalDefaultDescription
togglePropTypes.funcfalseShow hide action sheet
cancelButtonNamePropTypes.stringfalseCancelCancel button text
CancelButtonStylePropTypes.objecttrue-
contactTitleContainerPropTypes.objecttrue-
darkModePropTypes.booltruefalseSwitch action sheet to light and dark mode
dataPropTypes.array.isRequiredfalseArray

Contribution

Issues are welcome. Please add a screenshot of bug and code snippet. Quickest way to solve issue is to reproduce it on one of the examples.

Pull requests are welcome. If you want to change API or making something big better to create issue and discuss it first.


MIT Licensed