Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/enesozturk/rn-swipeable-panel
Zero dependency swipeable bottom panel for React Native 📱
https://github.com/enesozturk/rn-swipeable-panel
android bottom bottom-sheet ios panel react-native sheet swipeable
Last synced: 1 day ago
JSON representation
Zero dependency swipeable bottom panel for React Native 📱
- Host: GitHub
- URL: https://github.com/enesozturk/rn-swipeable-panel
- Owner: enesozturk
- License: mit
- Created: 2019-06-03T07:41:01.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2023-01-06T20:35:07.000Z (about 2 years ago)
- Last Synced: 2025-01-25T00:05:55.574Z (8 days ago)
- Topics: android, bottom, bottom-sheet, ios, panel, react-native, sheet, swipeable
- Language: TypeScript
- Homepage:
- Size: 46.9 MB
- Stars: 970
- Watchers: 10
- Forks: 143
- Open Issues: 59
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
React Native Swipeable Panel
**rn-swipeable-panel** is a swipeable, easy to use bottom panel for your React Native projects. You can extend panel by swiping up, make it small or close by swiping down with pan gestures. Feel free to redesign inside of the panel.
[![npm version](https://img.shields.io/npm/v/rn-swipeable-panel.svg)](https://www.npmjs.com/package/rn-swipeable-panel)
## ⚙️ Installation
To install the package;
```
$ yarn add rn-swipeable-panel
```✅ It is done!
## 🚀 How to use
```javascript
import React from 'react';
import { StyleSheet, Text, View } from 'react-native';import { SwipeablePanel } from 'rn-swipeable-panel';
export default App = () => {
const [panelProps, setPanelProps] = useState({
fullWidth: true,
openLarge: true,
showCloseButton: true,
onClose: () => closePanel(),
onPressCloseButton: () => closePanel(),
// ...or any prop you want
});
const [isPanelActive, setIsPanelActive] = useState(false);const openPanel = () => {
setIsPanelActive(true);
};const closePanel = () => {
setIsPanelActive(false);
};return (
Welcome to React Native!
To get started, edit App.js
{/* Your Content Here */}
);
};
```## ☝️ Options
| Properties | Type | Description | Default |
| ----------------------- | ---------- | ----------------------------------------------------------- | ------- |
| **isActive** | `bool` | Show/Hide the panel | `false` |
| **onClose** | `Function` | Fired when the panel is closed | |
| **showCloseButton** | `bool` | Set true if you want to show close button | |
| **fullWidth** | `bool` | Set true if you want to make full with panel | `false` |
| **openLarge** | `bool` | Set true if you want to open panel large by default | `false` |
| **onlyLarge** | `bool` | Set true if you want to let panel open just large mode | `false` |
| **onlySmall** | `bool` | Set true if you want to let panel open just small mode | `false` |
| **noBackgroundOpacity** | `bool` | Set true if you want to disable black background opacity | `false` |
| **style** | `Object` | Use this prop to override panel style | `{}` |
| **closeRootStyle** | `Object` | Use this prop to override close button background style | `{}` |
| **closeIconStyle** | `Object` | Use this prop to override close button icon style | `{}` |
| **barStyle** | `Object` | Use this prop to override bar style | `{}` |
| **smallPanelHeight** | `Object` | Use this prop to override the small panel default height | |
| **barContainerStyle** | `Object` | Use this prop to override bar container style | `{}` |
| **closeOnTouchOutside** | `bool` | Set true if you want to close panel by touching outside | `false` |
| **allowTouchOutside** | `bool` | Set true if you want to make toucable outside of panel | `false` |
| **noBar** | `bool` | Set true if you want to remove gray bar | `false` |
| **scrollViewProps** | `Object` | Use this prop to override scroll view that inside the panel | `{}` |#### ⭐️ Show Your Support
Please give a ⭐️ if this project helped you!
#### 👏 Contributing
If you have any questions or requests or want to contribute to `rn-swipeable-panel`, please write the [issue](https://github.com/enesozturk/rn-swipeable-panel/issues) or give me a Pull Request freely.