2.0.1 • Published 3 years ago

react-native-devansh-action-sheet v2.0.1

Weekly downloads
14
License
ISC
Repository
github
Last release
3 years ago

react-native-action-sheet

Custom action sheet/option picker for react native

Installation

npm install --save react-native-devansh-action-sheet

Importing

import React,{useState} from 'react';

import ActionSheet from 'react-native-devansh-action-sheet';

Example with Hooks

const [actionSheetVisibility,setActionSheetVisibility]=useState(false);

<Text onPress={() => setActionSheetVisibility(true)}>
        Show Action Sheet
  </Text>
        <ActionSheet
          onClose={() => setActionSheetVisibility(!actionSheetVisibility)} // to close the modal
          visibility={actionSheetVisibility}
          actionLabel={[
              {
              id:1,
              name:"Option 1"
            },
              {
              id:2,
              name:"Option 2",
               labelTextStyle: {
              fontSize: 30,
            },
            },
              {
              id:3,
              name:"Option 3",
               labelBackground: 'red',
               colored: true,
            },
             {
              id:4,
              name:"cancel",
              colored: true
            }
          ]}
          onActionLabelSelected={(val, index) => console.log(val, index)}
          heading={"My New Heading"}
        />