Gathering detailed insights and metrics for @lunalee/react-native-raw-bottom-sheet
Gathering detailed insights and metrics for @lunalee/react-native-raw-bottom-sheet
Gathering detailed insights and metrics for @lunalee/react-native-raw-bottom-sheet
Gathering detailed insights and metrics for @lunalee/react-native-raw-bottom-sheet
Add Your Own Component To Bottom Sheet Whatever You Want (Android and iOS)
npm install @lunalee/react-native-raw-bottom-sheet
Typescript
Module System
Node Version
NPM Version
71.3
Supply Chain
99.3
Quality
75.5
Maintenance
100
Vulnerability
100
License
JavaScript (100%)
Total Downloads
3,824
Last Day
6
Last Week
38
Last Month
211
Last Year
2,654
MIT License
4 Stars
113 Commits
1 Branches
1 Contributors
Updated on Dec 31, 2023
Latest Version
2.2.4
Package Id
@lunalee/react-native-raw-bottom-sheet@2.2.4
Unpacked Size
20.47 kB
Size
6.17 kB
File Count
12
NPM Version
9.6.6
Node Version
19.8.1
Published on
May 15, 2023
Cumulative downloads
Total Downloads
Last Day
0%
6
Compared to previous day
Last Week
-19.1%
38
Compared to previous week
Last Month
-29.4%
211
Compared to previous month
Last Year
188.5%
2,654
Compared to previous year
Showcase iOS | Showcase Android |
---|---|
![]() | ![]() |
npm i react-native-raw-bottom-sheet --save
yarn add react-native-raw-bottom-sheet
1import React, { Component } from "react"; 2import { View, Button } from "react-native"; 3import RBSheet from "react-native-raw-bottom-sheet"; 4 5export default class Example extends Component { 6 render() { 7 return ( 8 <View style={{ flex: 1, justifyContent: "center", alignItems: "center" }}> 9 <Button title="OPEN BOTTOM SHEET" onPress={() => this.RBSheet.open()} /> 10 <RBSheet 11 ref={ref => { 12 this.RBSheet = ref; 13 }} 14 height={300} 15 openDuration={250} 16 customStyles={{ 17 container: { 18 justifyContent: "center", 19 alignItems: "center" 20 } 21 }} 22 > 23 <YourOwnComponent /> 24 </RBSheet> 25 </View> 26 ); 27 } 28}
1import React, { useRef } from "react"; 2import { View, Button } from "react-native"; 3import RBSheet from "react-native-raw-bottom-sheet"; 4 5export default function Example() { 6 const refRBSheet = useRef(); 7 return ( 8 <View 9 style={{ 10 flex: 1, 11 justifyContent: "center", 12 alignItems: "center", 13 backgroundColor: "#000" 14 }} 15 > 16 <Button title="OPEN BOTTOM SHEET" onPress={() => refRBSheet.current.open()} /> 17 <RBSheet 18 ref={refRBSheet} 19 closeOnDragDown={true} 20 closeOnPressMask={false} 21 customStyles={{ 22 wrapper: { 23 backgroundColor: "transparent" 24 }, 25 draggableIcon: { 26 backgroundColor: "#000" 27 } 28 }} 29 > 30 <YourOwnComponent /> 31 </RBSheet> 32 </View> 33 ); 34}
1renderItem = (item, index) => ( 2 <View> 3 <Button title={`OPEN BOTTOM SHEET-${index}`} onPress={() => this[RBSheet + index].open()} /> 4 <RBSheet 5 ref={ref => { 6 this[RBSheet + index] = ref; 7 }} 8 > 9 <YourOwnComponent onPress={() => this[RBSheet + index].close()} /> 10 </RBSheet> 11 </View> 12);
Props | Type | Description | Default |
---|---|---|---|
animationType | string | Background animation ("none", "fade", "slide") | "none" |
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) |
customStyles: {
wrapper: {...}, // The Root of Component (You can change the `backgroundColor` 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 |
RBSheet
with react-native-gesture-handler, the components inside RBSheet will not fire onPress event on Android #37.example folder
.This project is licensed under the MIT License - see the LICENSE.md file for details
Made with ❤️ by NY Samnang.
No vulnerabilities found.
No security vulnerabilities found.