1.0.11 • Published 11 months ago

react-native-slide-bottomsheet v1.0.11

Weekly downloads
-
License
ISC
Repository
github
Last release
11 months ago

React Native Slide BottomSheet

React Native Slide BottomSheet is a customizable component for creating elegant bottom sheets in your React Native applications. It provides a great user experience with smooth animations and flexible height options.

Features

  • Customizable styles to match your app's design and theme.
  • Support for scrollable content within the bottom sheet.
  • Configurable backdrop with adjustable opacity and color.
  • Optional handle bar for easy interaction.
  • Responsive height options, including fixed height and percentage-based height.
  • Event callbacks for closing the bottom sheet and handling backdrop press.

Example

Installation

You can install package using npm or yarn:

npm install react-native-slide-bottomsheet

or

yarn add react-native-slide-bottomsheet

Usage

To use the BottomSheet component in your React Native application, simply import it and include it in your JSX:

import React from "react";
import { View, Text } from "react-native";
import BottomSheet from "react-native-slide-bottomsheet";

const App = () => {
  return (
    <View>
      <Text>React Native Slide Bottomsheet</Text>
      <BottomSheet
        visible={true}
        onClose={() => console.log("Bottom sheet closed")}
      >
        <View>
          <Text>Content inside the bottom sheet</Text>
        </View>
      </BottomSheet>
    </View>
  );
};

export default App;

Props

The following table describes the available props for the React Native BottomSheet component:

PropTypeDescription
visiblebooleanWhether the bottom sheet is visible or not.
onClose() => voidCallback function when the bottom sheet is closed.
childrenReact.ReactNodeContent of the bottom sheet.
heightnumber | stringHeight of the bottom sheet (can be a number or a string with percentage).
scrollablebooleanWhether the content of the bottom sheet is scrollable.
animationDurationnumberDuration of the animation for opening/closing the bottom sheet.
backdropobjectConfigurations for the backdrop behind the bottom sheet.
backdrop.backdropOpacitynumberOpacity of the backdrop.
backdrop.backdropColorstringColor of the backdrop.
styleobjectCustom styles for the bottom sheet container.
style.backgroundColorstringBackground color of the bottom sheet.
style.borderTopLeftRadiusnumberTop left border radius of the bottom sheet.
style.borderTopRightRadiusnumberTop right border radius of the bottom sheet.
style.borderColorstringBorder color of the bottom sheet.
style.borderWidthnumberBorder width of the bottom sheet.
style.shadowColorstringShadow color of the bottom sheet.
style.shadowOffset{ width: number, height: number }Shadow offset of the bottom sheet.
style.shadowRadiusnumberShadow radius of the bottom sheet.
style.elevationnumberElevation of the bottom sheet (Android only).
handleBarVisiblebooleanWhether to show the handle bar at the top of the bottom sheet.
handleBarStyleobjectCustom styles for the handle bar.
handleBarStyle.backgroundColorstringBackground color of the handle bar.
handleBarStyle.widthnumberWidth of the handle bar.
handleBarStyle.heightnumberHeight of the handle bar.
onBackdropPress() => voidCallback function when the backdrop is pressed.

Contributing

Contributions are welcome! If you have any ideas, suggestions, or bug reports, please open an issue or submit a pull request. Let's make this package even better together!

License

This project is licensed under the GNU GENERAL PUBLIC LICENSE Version 3.

1.0.11

11 months ago

1.0.10

11 months ago

1.0.9

11 months ago

1.0.8

11 months ago

1.0.7

11 months ago

1.0.6

11 months ago

1.0.5

11 months ago

1.0.4

11 months ago

1.0.3

11 months ago

1.0.2

11 months ago

1.0.1

11 months ago

1.0.0

11 months ago