# React Native Gesture Bottom Sheet
Need a lightweight and easy-to-use bottom sheet component? Here it is!
A cross-platform Bottom Sheet component which supports gestures.
![](bottom-sheet.gif)
- Checkout the [example/](https://github.com/kcotias/react-native-gesture-bottom-sheet/tree/master/examples) folder for use example.
## Features
- Smooth animations and gestures
- Highly customizable
- Very lightweight
## Installation
Open a Terminal in the project root and run:
```sh
yarn add react-native-gesture-bottom-sheet
```
## Quick Start
```js
import React, { useRef } from "react";
import { SafeAreaView, TouchableOpacity, Text, StyleSheet } from "react-native";
import BottomSheet from "react-native-gesture-bottom-sheet";
const Example = () => {
// Needed in order to use .show()
const bottomSheet = useRef();
return (
<SafeAreaView style={styles.container}>
<BottomSheet
hasDraggableIcon
ref={bottomSheet}
height={600}
onRequestClose={() => {
bottomSheet.current.close();
}}
/>
<TouchableOpacity
style={styles.button}
onPress={() => bottomSheet.current.show()}
>
<Text style={styles.text}>Open modal</Text>
</TouchableOpacity>
</SafeAreaView>
);
};
const styles = StyleSheet.create({
button: {
height: 50,
width: 150,
backgroundColor: "#140078",
justifyContent: "center",
alignItems: "center",
borderRadius: 20,
shadowColor: "#8559da",
shadowOpacity: 0.7,
shadowOffset: {
height: 4,
width: 4,
},
shadowRadius: 5,
elevation: 6,
},
text: {
color: "white",
fontWeight: "600",
},
container: {
flex: 1,
justifyContent: "center",
alignItems: "center",
},
});
export default Example;
```
### Props
| name | required | default | Type | description |
| ------------------------- | -------- | ----------| --------| ------------|
| height | Yes | | integer | Determines the panel size.|
| radius | No | 10 | integer | Determines the radius of the top borders.|
| onRequestClose | No | | function | Function to callback while requesting bottom-sheet to close|
| hasDraggableIcon | No | false | boolean | Controls visibility of the draggable icon on top of the modal.|
| draggable | No | true | boolean | Specify whether the panel is draggable or not.|
| backgroundColor | No |`#25252599`| string | Change the color of the overlay.|
| sheetBackgroundColor | No |`#F3F3F3` | string | Change the background of the panel.|
没有合适的资源?快使用搜索试试~ 我知道了~
需要轻巧易用的底板组件吗?这里是!_JavaScript_下载.zip
共76个文件
js:11个
png:10个
json:7个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 9 浏览量
2023-05-01
00:45:06
上传
评论
收藏 1.87MB ZIP 举报
温馨提示
需要轻巧易用的底板组件吗?这里是!_JavaScript_下载.zip
资源推荐
资源详情
资源评论
收起资源包目录
需要轻巧易用的底板组件吗?这里是!_JavaScript_下载.zip (76个子文件)
react-native-gesture-bottom-sheet-master
.DS_Store 6KB
src
BottomSheet
index.d.ts 898B
index.js 4KB
styles.js 599B
LICENSE 1KB
examples
.watchmanconfig 2B
.buckconfig 114B
yarn.lock 286KB
babel.config.js 76B
.eslintrc.js 74B
app.json 53B
metro.config.js 300B
.gitattributes 16B
src
index.js 753B
styles.js 535B
android
gradle.properties 910B
gradle
wrapper
gradle-wrapper.jar 54KB
gradle-wrapper.properties 200B
app
build_defs.bzl 602B
src
debug
AndroidManifest.xml 368B
main
java
com
examples
MainApplication.java 2KB
MainActivity.java 343B
res
mipmap-xxhdpi
ic_launcher_round.png 10KB
ic_launcher.png 6KB
mipmap-hdpi
ic_launcher_round.png 5KB
ic_launcher.png 3KB
mipmap-mdpi
ic_launcher_round.png 3KB
ic_launcher.png 2KB
mipmap-xxxhdpi
ic_launcher_round.png 15KB
ic_launcher.png 9KB
mipmap-xhdpi
ic_launcher_round.png 7KB
ic_launcher.png 4KB
values
strings.xml 71B
styles.xml 246B
AndroidManifest.xml 970B
proguard-rules.pro 435B
build.gradle 8KB
debug.keystore 2KB
BUCK 1KB
gradlew.bat 3KB
build.gradle 999B
settings.gradle 192B
gradlew 6KB
.flowconfig 2KB
.prettierrc.js 120B
App.js 247B
package.json 767B
package-lock.json 364KB
ios
Podfile 3KB
examples
Images.xcassets
Contents.json 63B
AppIcon.appiconset
Contents.json 585B
Base.lproj
LaunchScreen.xib 4KB
AppDelegate.h 386B
AppDelegate.m 1KB
main.m 390B
Info.plist 2KB
examples-tvOS
Info.plist 1KB
examples.xcodeproj
xcshareddata
xcschemes
examples.xcscheme 5KB
examples-tvOS.xcscheme 5KB
project.pbxproj 39KB
examples-tvOSTests
Info.plist 765B
examples.xcworkspace
contents.xcworkspacedata 226B
Podfile.lock 12KB
examplesTests
examplesTests.m 2KB
Info.plist 733B
index.js 187B
.gitignore 813B
index.d.ts 45B
.babelrc 60B
package.json 1KB
package-lock.json 43KB
bottom-sheet.gif 1.68MB
.npmignore 136B
index.js 74B
.gitignore 111B
README.md 3KB
共 76 条
- 1
资源评论
快撑死的鱼
- 粉丝: 1w+
- 资源: 9154
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功