Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-native-sheets-bottom

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-sheets-bottom

Kind of Sheets Bottom for react native

  • 1.0.5
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
418
increased by57.74%
Maintainers
1
Weekly downloads
 
Created
Source

React Native Sheets Bottom

react-native-sheets-bottom ise 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.

NOTE: IT currentlt supports pattern the modal-bottom-sheet. Roadmap is to support expand to full screen.

npm version



⚙️ Installation

$ npm i react-native-sheets-bottom

🚀 How to use

import React from "react";
import { StyleSheet, Text, View } from "react-native";

import SwipeablePanel from "react-native-sheets-bottom";

export default class App extends Component {
  constructor(props) {
    super(props);
    this.state = {
      swipeablePanelActive: false
    };
  }

  componentDidMount = () => {
    this.openPanel();
  };

  openPanel = () => {
    this.setState({ swipeablePanelActive: true });
  };

  closePanel = () => {
    this.setState({ swipeablePanelActive: false });
  };

  render() {
    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
          fullWidth
          isActive={this.state.swipeablePanelActive}
          onClose={this.closePanel}
          onPressCloseButton={this.closePanel}
        >
          <PanelContent /> {/* Your Content Here */}
        </SwipeablePanel>
      </View>
    );
  }
}

☝️ Options


PropertiesTypeDescriptionDefault
barStyleObjectUse this prop to override bar style{}
closeIconStyleObjectUse this prop to override close button icon style{}
closeOnTouchOutsideboolSet true if you want to close panel by touching outsidefalse
closeOnTouchOutsideboolSet true if you want to close panel by touching outsidefalse
closeRootStyleObjectUse this prop to override close button background style{}
fullWidthboolSet true if you want to make full with panelfalse
gestureThresholdNumberTop bar pan gesture threshold100
isActiveboolShow/Hide the panelfalse
noBackgroundOpacityboolSet true if you want to disable black background opacityfalse
noBarboolSet true if you want to remove gray barfalse
onCloseFunctionFired when the panel is closed
onlyLargeboolSet true if you want to let panel open just large modefalse
openLargeboolSet true if you want to open panel large by defaultfalse
showCloseButtonboolSet true if you want to show close button
styleObjectUse this prop to override panel style{}
TODO list since fork
  • (DONE) create gestureThreshold new prop
  • (DONE) Configure Travis CI and semantic-release so we automatically release new version up on code merge into master
  • (In progress) Configure Prettier and Eslint so new contributors have a better dev experience
  • Update README with the new sample UI
  • Create animation prop to customize speed and behaviour
  • Swipe to full screen mode like https://material.io/components/sheets-bottom/# (far in the roadmap)
Developer set up
  • npm i - in root directory
  • cd examples
  • npm i
  • npm start
  • in another tab: cd ios && pod install && cd ..
  • react-native run-ios or react-native run-android

This is a fork from: https://github.com/enesozturk/rn-swipeable-panel - all credits to original package creator https://github.com/enesozturk

Keywords

FAQs

Package last updated on 01 Apr 2020

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc