npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

akbari-side-menu

v2.0.1

Published

Made with create-react-library

Downloads

8

Readme

akbari-side-menu - React-Side-Menu

React side menu

This is the best React Side Menu with ability Swipe and Touch . Rtl and Ltr Direction .

Demo

Demo

demo

How To Install Step By Step

Step-One

run

npm install hammerjs 

Step-Two

run

npm install akbari-side-menu 

Step-Three

import these lines in App.js . App.js is in Src/App.js   of react project .

import { AkbariSideMenu } from 'akbari-side-menu/dist/index';
import 'akbari-side-menu/dist/index.css';

dont forget top lines specially css file

Step-Four

simple example of use


  <AkbariSideMenu
     ref={this.rightSideMenu}
     pcWidth={50}
     mobileWidth={80}
     onClose={this.onClose.bind(this)}
     onOpen={this.onOpen.bind(this)}
     direction={'rtl'}
     showCloseButton={true}
   >

                //// you can write any html and react and css code here 

  </AkbariSideMenu>

full example of code


import React from 'react'; 

import { AkbariSideMenu } from 'akbari-side-menu/dist/index';
import 'akbari-side-menu/dist/index.css';


export default class Home extends React. Component {

    constructor() {
        super();
        this.sideRef = React.createRef();

    }

 

    openSideMenu() {
        this.sideRef.current.open();

    }

    onOpen() {

    }

    onClose() {

    }

    render() {
        return (
            <>

      <button type="button" className="right" onClick={this.openSideMenu.bind(this)} >open side menu </button>

             

                <AkbariSideMenu
                    ref={this.sideRef}
                     pcWidth={50}
                     mobileWidth={80}
                     onClose={this.onClose.bind(this)}
                     onOpen={this.onOpen.bind(this)}
                     direction={'rtl'}
                    showCloseButton={true}
                >

                    <div className="header">
                        <div className="one">
                            <img src="./assets/img/my.jpg" />
                        </div>
                        <div className="two">Mohamadreza Akbari</div>

                    </div>

                    <div className="menu">
                        <div className="item">Home</div>
                        <div className="item">About</div>
                        <div className="item">Contact</div>
                        <div className="item">Map</div>

                    </div>

                </AkbariSideMenu>

            </>
        )

    }

}

how to open and close Side Menu

first you have to create ref for AkbariSideMenu

html code


<AkbariSideMenu
 ref={this.sideRef}
</AkbariSideMenu>

js code


 constructor() {
        super(); 
        this.sideRef = React.createRef(); 

    }

then you can call open and close method in AkbariSideMenu


open(){
 this.sideRef.current.open(); 
}
close(){
   this.sideRef.current.close(); 
}

props

pcWidth => type = number => this is percent of width in pc that you have to set a number between 0 and 100

Example

   <AkbariSideMenu

      pcWidth={60}

   </AkbariSideMenu>

this example means 60% of window width

mobileWidth => type = number => this is percent of width in mobile devices that you have to set a number between 0 and 100

Example

   <AkbariSideMenu

      mobileWidth={60}

   </AkbariSideMenu>

this example means 60% of window width

direction => type = string => direction of side menu = > values => 'rtl' or 'ltr'

you can set side menu open from right or left .

   <AkbariSideMenu

      direction={'rtl'}

   </AkbariSideMenu>

showCloseButton => type = boolean = > values = true or false

this prop is for show close button or hide close button

   <AkbariSideMenu

      showCloseButton={true}

   </AkbariSideMenu>

onOpen

this prop is for detect side menu opened

html

   <AkbariSideMenu

      onOpen={this.onOpen.bind(this)}

   </AkbariSideMenu>

js

onOpen(event){

}

onClose

this prop is for detect side menu closed

html

   <AkbariSideMenu

     onClose={this.onClose.bind(this)}

   </AkbariSideMenu>

js

onClose(event){

}

finally

hope to enjoy it ;

report bugs to [email protected]