Research
Security News
Kill Switch Hidden in npm Packages Typosquatting Chalk and Chokidar
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
@nonam4/react-native-bottom-sheet
Advanced tools
Add Whatever You Want To Bottom Sheet (Android & iOS)
Showcase iOS | Showcase Android |
---|---|
npm i @nonam4/react-native-bottom-sheet --save
yarn add @nonam4/react-native-bottom-sheet
import React, { Component } from "react";
import { View, Button } from "react-native";
import RBSheet from "@nonam4/react-native-bottom-sheet";
export default class Example extends Component {
render() {
return (
<View style={{ flex: 1, justifyContent: "center", alignItems: "center" }}>
<Button title="OPEN BOTTOM SHEET" onPress={() => this.RBSheet.open()} />
<RBSheet
ref={ref => {
this.RBSheet = ref;
}}
height={300}
openDuration={250}
customStyles={{
container: {
justifyContent: "center",
alignItems: "center"
}
}}
>
<YourOwnComponent />
</RBSheet>
</View>
);
}
}
import React, { useRef } from "react";
import { View, Button } from "react-native";
import RBSheet from "@nonam4/react-native-bottom-sheet";
export default function Example() {
const refRBSheet = useRef<RBSheet | null>(null);
return (
<View
style={{
flex: 1,
justifyContent: "center",
alignItems: "center",
backgroundColor: "#000"
}}
>
<Button title="OPEN BOTTOM SHEET" onPress={() => refRBSheet.current?.open()} />
<RBSheet
ref={refRBSheet}
closeOnDragDown={true}
closeOnPressMask={false}
customStyles={{
wrapper: {
backgroundColor: "transparent"
},
draggableIcon: {
backgroundColor: "#000"
}
}}
>
<YourOwnComponent />
</RBSheet>
</View>
);
}
renderItem = (item, index) => (
<View>
<Button title={`OPEN BOTTOM SHEET-${index}`} onPress={() => this[RBSheet + index].open()} />
<RBSheet
ref={ref => {
this[RBSheet + index] = ref;
}}
>
<YourOwnComponent onPress={() => this[RBSheet + index].close()} />
</RBSheet>
</View>
);
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 |
minStartHeight | number | Minimum starting height of the bottom sheet before opening | 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 |
onOpen | function | Callback function when Bottom Sheet has opened | null |
onClose | function | Callback function when Bottom Sheet has closed | 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.
Edited/updated by NoNam4.
FAQs
Add Whatever You Want To Bottom Sheet (Android & iOS)
The npm package @nonam4/react-native-bottom-sheet receives a total of 64 weekly downloads. As such, @nonam4/react-native-bottom-sheet popularity was classified as not popular.
We found that @nonam4/react-native-bottom-sheet demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.