GithubHelp home page GithubHelp logo

suretarget / rn-swipeable-panel Goto Github PK

View Code? Open in Web Editor NEW

This project forked from enesozturk/rn-swipeable-panel

0.0 1.0 0.0 19.11 MB

Swipeable bottom panel for React Native ๐Ÿ“ฑ

JavaScript 100.00%

rn-swipeable-panel's Introduction


React Native Swipeable Panel

React Native Panel animates up and controllable with pan gestures
To see other examples click here

npm version


React Native Swipeable Panel that animate from bottom and controllable with pan gestures. You can extend panel by swiping up, make it small or close by swiping down with pan gestures. Feel free to redesign inside of panel

โš™๏ธ Installation

$ npm install rn-swipeable-panel --save

or

$ yarn add rn-swipeable-panel

๐Ÿš€ How to use

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

import SwipeablePanel from 'rn-swipeable-panel';


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


Properties Type Description Default
isActive bool Show/Hide the panel false
onClose Function Fired when the panel is closed
onPressCloseButton Function Use this if you want to show close button. Using same function with onClose is recommended as example above
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
noBackgroundOpacity bool Set true if you want to disable black background opacity false

๐Ÿ“ฆ Releases

  • 1.0.2 - Initial release
  • 1.0.3 - Full width option
  • 1.0.4 - Prop and styling fixes
  • 1.0.5 - Disable swipe up when panel is full open
  • 1.0.6 - Scrollable content and close button
  • 1.0.7 - Changes for nested scrollview usage (Horizontal scrollview)
  • 1.0.8 - Optional close button
  • 1.0.9 - useNativeDriver for better performance
  • 1.0.11 - openLarge parameter added
  • 1.0.11 - Added noBackgroundOpacity parameter

โ˜‘๏ธ TODOs

  • Add full width option
  • Disable swipe up when panel is full open
  • Scrollable content
  • Add close button
  • Horizontal scrollview inside the panel
  • Optional close button
  • Native driver for all animations for better performance
  • Open large panel by default
  • Add option to disable black background opacity

โญ๏ธ 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.

rn-swipeable-panel's People

Contributors

enesozturk avatar dependabot[bot] avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.