A bottom sheet that uses Material sheets #specs. Written in pure JS.
npm i react-native-bottom-sheet-js
yarn add react-native-bottom-sheet-js
if you are using Yarn
import BottomSheet from 'react-native-bottom-sheet-js'// To open sheet dothisbottomSheet// Always put <BottomSheet> at the very bottom of the screen file<View>/* Other content here. */<BottomSheet=><Text>This is the content that will display when the bottom sheet is open</Text></BottomSheet></View>
Color of the background
Minimum height of the sheet when open. default value is 56 as stated https://material.io/components/sheets-bottom/#specs the minimum height of a sheet must be 56dp.
Maximum height of the sheet when open(only triggers when you have a lot of content). default value is 50%(Dimensions.get('window).height) of the screen height. as stated https://material.io/components/sheets-bottom/#specs the maximum height of a sheet must be half of the screen size which is 50%.
Style of the content component. Only accepts object as a parameter. If you specify a height on this component be sure to have it <= maxHeight so it won't clamp and render stuff out of place. You can add paddings or margins here.
- Opens the bottom sheet.
- Closes the sheet.
- Open or closes the sheet based on last state.
Open for PR's. Any improvements or fixes are welcome!