1.0.4 • Published 1 year ago

@irfanwani/react-native-bottom-sheet v1.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

React Native BottomSheet

For displaying a bottom sheet in a react native app.

How to thank me ?

Just click on ⭐️ button 😘

https://user-images.githubusercontent.com/62456735/205438152-b4fae14a-ba49-4bea-a965-eb2175203ea8.mov

Installation:

npm install --save @irfanwani/react-native-bottom-sheet
OR
yarn add @irfanwani/react-native-bottom-sheet

Basic Usage

import { FC, useRef, useState } from "react";
import { Button, View, Animated, Dimensions } from "react-native";

import BottomSheet from "@irfanwani/react-native-bottom-sheet";

const App: FC = () => {
  const [visible, setVisible] = useState(false);
  const showsheet = () => {
    setVisible(true);
  };

  return (
    <View style={{ flex: 1, justifyContent: "center" }}>
      <BottomSheet
        visible={visible}
        onClose={() => {
          setVisible(false);
        }}
      >
        <Text>Here are the children elements</Text>
      </BottomSheet>
      <Button title="show sheet" onPress={showsheet} />
    </View>
  );
};

export default App;

Props

PropTypeRequiredNote
visiblebooleanTrueDetermines whether the bottomsheet is shown or not
childrenReactElement or nullTrueElement to show in the bottom sheet
onClose() => voidTrueCalled when the bottomsheet is closed
onShow() => voidFalseCalled when the bottomsheet opens
styleViewStyleFalseCustomStyles for the bottomsheet
draggerViewStyleViewStyleFalseCustomStyles for the dragger container view
draggerStyleViewStyleFalseCustomStyles for the dragger Icon
draggablebooleanFalsewhether to show the dragger view or not