Add Your Own Component To Bottom Sheet Whatever You Want (Android & iOS)
npm install rn-raw-bottom-sheet
- Super Lightweight Component
- Add Your own Component To Bottom Sheet
- Customize Whatever You Like
- Support Drag Down Gesture
- Support All Orientations
- Support Both Android And iOS
- Smooth Animation
- Zero Configuration
- Zero dependency
- Top Search Ranking (react native bottom sheet) at npms.io
| Showcase iOS | Showcase Android |
| :--------------------------------------------------------------------------------------------------------------------: |
```
npm i rn-raw-bottom-sheet --save
``
yarn add rn-raw-bottom-sheet
#### Class component
`jsx
import React, { Component } from "react";
import { View, Button } from "react-native";
import RBSheet from "rn-raw-bottom-sheet";
export default class Example extends Component {
render() {
return (
);
}
}
`
#### Functional component
`jsx
import React, { useRef } from "react";
import { View, Button } from "react-native";
import RBSheet from "rn-raw-bottom-sheet";
export default function Example() {
const refRBSheet = useRef();
return (
flex: 1,
justifyContent: "center",
alignItems: "center",
backgroundColor: "#000"
}}
>
#### Dynamic Bottom Sheet
`jsx`
renderItem = (item, index) => (
);
| Props | Type | Description | Default |
| ---------------- | -------- | ------------------------------------------------------- | -------- |
| animationType | string | Background animation ("none", "fade", "slide") | "none" |
| statusBarTranslucent | boolean | Android Status Bar(true , false) | "false" |
| height | number | Height of Bottom Sheet | 260 |
| minClosingHeight | number | Minimum height of Bottom Sheet before close | 0 |
| openDuration | number | Open Bottom Sheet animation duration | 300 (ms) |
| closeDuration | number | Close Bottom Sheet animation duration | 200 (ms) |
| closeOnDragDown | boolean | Use gesture drag down to close Bottom Sheet | false |
| dragFromTopOnly | boolean | Drag only the top area of the draggableIcon to close Bottom Sheet instead of the whole content | false |
| closeOnPressMask | boolean | Press the area outside to close Bottom Sheet | true |
| closeOnPressBack | boolean | Press back android to close Bottom Sheet (Android only) | true |
| onClose | function | Callback function when Bottom Sheet has closed | null |
| onOpen | function | Callback function when Bottom Sheet has opened | null |
| customStyles | object | Custom style to Bottom Sheet | {} |
| keyboardAvoidingViewEnabled | boolean | Enable KeyboardAvoidingView | true (ios) |
`backgroundColor
customStyles: {
wrapper: {...}, // The Root of Component (You can change the or any styles)``
container: {...}, // The Container of Bottom Sheet
draggableIcon: {...} // The Draggable Icon (If you set closeOnDragDown to true)
}
| Method Name | Description |
| ----------- | ------------------ |
| open | Open Bottom Sheet |
| close | Close Bottom Sheet |
This project is licensed under the MIT License - see the LICENSE.md file for details
Made with ❤️ by NY Samnang.