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

react-mobile-drawer

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-mobile-drawer

Simple react drawer component with touch events support

  • 0.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
24
increased by20%
Maintainers
1
Weekly downloads
 
Created
Source

react-mobile-drawer

Simple react drawer component with touch events support

Example: https://ilyacuc.github.io/react-mobile-drawer/

Usage

import React from "react";
import ReactDOM from "react-dom";
import Drawer from 'react-mobile-drawer';

class App extends React.PureComponent {
constructor(props) {
    super(props);
    this.state = {
        isOpen: false
    }
}

closeDrawer = () => {
    this.setState({isOpen: false});
}

openDrawer = () => {
    this.setState({isOpen: true});
}

render() {
    return (
        <div>
            <Drawer isOpen={this.state.isOpen} closeDrawer={this.closeDrawer} openDrawer={this.openDrawer}>
                <div>Menu content here</div>
            </Drawer>
            <button onClick={this.openDrawer}>Open Drawer</button>
            <div>Main content here</div>
        </div>
    );
}
}

ReactDOM.render(<App/>, document.getElementById("app"));

Props

Prop NameDefault ValueDescription
isOpenfalsecontrols state of drawer
backdropClassNameempty stringclass name to style backdrop
drawerClassNameempty stringclass name to style drawer container
width80drawer width in %
sideZoneWidth30width of side drawing zone in px
closeDrawerempty functionfunction to control state of drawer
openDrawerempty functionfunction to control state of drawer

Keywords

FAQs

Package last updated on 10 Dec 2018

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