1.2.7 ā€¢ Published 2 years ago

rn-swipeable-panel v1.2.7

Weekly downloads
1,032
License
MIT
Repository
github
Last release
2 years ago

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.

1.2.7

2 years ago

1.2.6

3 years ago

1.2.5

3 years ago

1.2.3

3 years ago

1.2.2

3 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.15

4 years ago

1.1.14

4 years ago

1.1.12

4 years ago

1.1.13

4 years ago

1.1.9

4 years ago

1.1.8

4 years ago

1.1.1

4 years ago

1.1.7

4 years ago

1.1.6

4 years ago

1.1.5

4 years ago

1.1.4

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.1.0

4 years ago

1.0.29

4 years ago

1.0.28

4 years ago

1.0.27

4 years ago

1.0.26

4 years ago

1.0.25

4 years ago

1.0.24

4 years ago

1.0.23

4 years ago

1.0.22

4 years ago

1.0.21

4 years ago

1.0.20

4 years ago

1.0.19

4 years ago

1.0.18

4 years ago

1.0.17

4 years ago

1.0.16

4 years ago

1.0.15

4 years ago

1.0.14

5 years ago

1.0.13

5 years ago

1.0.12

5 years ago

1.0.11

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago