
Company News
/Security News
Socket Selected for OpenAI's Cybersecurity Grant Program
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.
react-native-animated-bottom-drawer
Advanced tools
A lightweight, highly performant and animated bottom drawer for react native
A lightweight and highly performant bottom drawer for react native
useBottomDrawer hook to allow the bottom drawer child components to access bottom drawer methodsusing npm
npm i react-native-animated-bottom-drawer
using yarn
yarn add react-native-animated-bottom-drawer
import React, {useRef} from 'react';
import {View, Text, StyleSheet, Button, SafeAreaView} from 'react-native';
import BottomDrawer, {
BottomDrawerMethods,
} from 'react-native-animated-bottom-drawer';
const App = () => {
// ref
const bottomDrawerRef = useRef<BottomDrawerMethods>(null);
// renders
return (
<SafeAreaView style={styles.container}>
<Button title="Open" onPress={() => bottomDrawerRef.current.open()} />
<BottomDrawer ref={bottomDrawerRef} openOnMount>
<View style={styles.contentContainer}>
<Text>Awesome 🎉</Text>
</View>
</BottomDrawer>
</SafeAreaView>
);
};
const styles = StyleSheet.create({
container: {
flex: 1,
padding: 24,
},
contentContainer: {
flex: 1,
alignItems: 'center',
},
});
export default App;
| Name | Type | Default | Description | Required |
|---|---|---|---|---|
gestureMode | handle content none | handle | This prop determines where to apply the gestures | No |
openDuration | number | 450 | Animation duration when the bottom drawer is opened | No |
closeDuration | number | 300 | Animation duration when the bottom drawer is closed | No |
onOpen | function | null | Callback function when the bottom drawer is opened | No |
onClose | function | null | Callback function when the bottom drawer is closed | No |
onBackdropPress | function | true | Callback function when the backdrop is pressed | No |
onBackPress | function | null | Callback function when the hardware back button is pressed | No |
closeOnPressBack | boolean | true | Setting this true will allow the bottom drawer to close when hardware back is pressed (only on android) | No |
closeOnBackdropPress | boolean | true | Setting this true will allow the bottom drawer to close when backdrop is pressed | No |
openOnMount | boolean | false | Setting this true will automatically open the bottom drawer when the parent component is mounted | No |
enableSnapping | boolean | false | Set this to true when you want to snap the bottom drawer to multiple heights | No |
snapPoints | number[] | [400] | Points for the bottom sheet to snap to, points should be sorted from bottom to top. It accepts array of number. Example: [300, 500, 700] | Yes, if enableSnapping is true |
backdropColor | string | #000 | Color of the backdrop | No |
backdropOpacity | number | 0.5 | Opacity of the backdrop | No |
customStyles | object | {} | Add your custom styles here! | No |
overDrag | boolean | true | Setting this true will allow the bottom sheet to be overdragged | No |
initialIndex | number | 0 | The initial index out of snapPoints when the bottom sheet is opened | No |
initialHeight | number | 420 | The initial height of the bottom sheet when opened. Note: This prop is not available when enableSnapping is set to true | No |
safeTopOffset | number | 50 | Minimum safe distance from top while dragging the sheet or keyboard is opened | No |
These methods can be accessed by bottom drawer reference or useBottomDrawer hook.
Opens the bottom drawer
type open = (
// open at provided sheetHeight
sheetHeight?: number,
) => void;
NOTE: sheetHeight is only read when enableSnapping is set to false. If enableSnapping is true, then the bottom sheet will be opened at index 0 out of snapPoints.
Closes the bottom drawer
type close = () => void;
Snaps the bottom drawer to given position
type snapToPosition = (
sheetHeight: number,
config?: {
resetLastPosition?: boolean;
},
) => void;
Snaps the bottom drawer to given index out of snapPoints (requires enableSnapping to be true)
type snapToIndex = (index: number) => void;
NOTE: This method is only accessible when enableSnapping is set to true.
FAQs
A lightweight, highly performant and animated bottom drawer for react native
We found that react-native-animated-bottom-drawer 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.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.

Security News
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.

Research
/Security News
Campaign of 108 extensions harvests identities, steals sessions, and adds backdoors to browsers, all tied to the same C2 infrastructure.