🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

rn-swipeable-panel

Package Overview
Dependencies
Maintainers
1
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rn-swipeable-panel

Swipeable bottom panel for react native

1.2.7
latest
Source
npm
Version published
Weekly downloads
637
-13.45%
Maintainers
1
Weekly downloads
 
Created
Source

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



⚙️ Installation

To install the package;

$ yarn add rn-swipeable-panel

✅ It is done!

🚀 How to use

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 (
    <View style={styles.container}>
      <Text style={styles.welcome}>Welcome to React Native!</Text>
      <Text style={styles.instructions}>To get started, edit App.js</Text>
      <SwipeablePanel {...panelProps} isActive={isPanelActive}>
        <PanelContent /> {/* Your Content Here */}
      </SwipeablePanel>
    </View>
  );
};

☝️ Options


PropertiesTypeDescriptionDefault
isActiveboolShow/Hide the panelfalse
onCloseFunctionFired when the panel is closed
showCloseButtonboolSet true if you want to show close button
fullWidthboolSet true if you want to make full with panelfalse
openLargeboolSet true if you want to open panel large by defaultfalse
onlyLargeboolSet true if you want to let panel open just large modefalse
onlySmallboolSet true if you want to let panel open just small modefalse
noBackgroundOpacityboolSet true if you want to disable black background opacityfalse
styleObjectUse this prop to override panel style{}
closeRootStyleObjectUse this prop to override close button background style{}
closeIconStyleObjectUse this prop to override close button icon style{}
barStyleObjectUse this prop to override bar style{}
smallPanelHeightObjectUse this prop to override the small panel default height
barContainerStyleObjectUse this prop to override bar container style{}
closeOnTouchOutsideboolSet true if you want to close panel by touching outsidefalse
allowTouchOutsideboolSet true if you want to make toucable outside of panelfalse
noBarboolSet true if you want to remove gray barfalse
scrollViewPropsObjectUse 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 or give me a Pull Request freely.

Keywords

react

FAQs

Package last updated on 31 Dec 2021

Did you know?

Socket

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.

Install

Related posts