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

@stanislav7766/rn-menu-drawer

v1.1.0

Published

menu drawer component for react-native

Downloads

7

Readme

Installation:

npm install --save @stanislav7766/rn-menu-drawer

yarn add @stanislav7766/rn-menu-drawer

Examples:

MenuDrawer usage:

// body of your component
...
// impelementing MenuContent, YourScreen
...
  const [showMenu, setShowMenu] = useState(false);
...
 const ScreenWithMenu = (
    <MenuDrawer
      open={showMenu}
      onShowMenu={setShowMenu}
      opacity={0.35}
      backgroundColor='#000'
      drawerWidth={300}
      animationTime={250}
      allowedSwipeWidth={200}
      tapToClose
      paddingGesture={50}
      position="right"
      MenuContent={SomeMenuContent}>
      {YourScreen}
    </MenuDrawer>
  );
...
// return
return {ScreenWithMenu};

useMenuDrawer(default params) usage:

// body of your component
...
// impelementing MenuContent, YourScreen
...
   const [ScreenWithMenu] = useMenuDrawer({
    MenuContent,
    children: YourApp,
  });
...
// return
return {ScreenWithMenu};

useMenuDrawer usage:

// body of your component
...
// impelementing MenuContent, YourScreen
...
  const [ScreenWithMenu, onShowMenu, onHideMenu] = useMenuDrawer({
    opacity: 0.35,
    backgroundColor: '#000',
    drawerWidth: 300,
    animationTime: 250,
    tapToClose: true,
    paddingGesture: 50,
    position: 'left',
    MenuContent,
    children: YourApp,
  });
...
//calling onShowMenu, onHideMenu for managing menu side. For example, onPress
...
// return
return {ScreenWithMenu};

Video usage:

see video

Props:

MenuDrawer Props:

| Prop | Type | Required | Default Value | Desciption | | ----------------- | ----------------------- | -------- | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | open | boolean | true | - | If true, shows menu side otherwise hides | | onShowMenu | (show: boolean) => void | true | - | Need for manage open prop | | tapToClose | boolean | true | - | If true, single tap outside of menu area - hides menu otherwise notihing happened | | position | 'left', 'right' | true | - | Set menu position on screen | | paddingGesture | number | true | - | Define area for hand gesture to show menu | | drawerWidth | number | true | - | Set menu width on screen | | allowedSwipeWidth | number | false | width_screen*0.5 | Set width of hand swipe that manages menu side. If real swipe's width >= 'your_value', menu side will be opened\hidden otherwise will be returned to it's original | | animationTime | number | true | - | Set animation time on show\hide menu side | | opacity | number | true | - | Set max opacity value to children's mask. Opacity will be dynamically changed from 0 to 'your_value' on 'moving state'. Use range 0..1 | | backgroundColor | string | true | - | Set background color to children's mask. Background color will be applied to mask on 'moving state' only. Use hex or rgb colors | | MenuContent | JSX.Element | true | - | It's your component that will be rendered on menu side | | children | React.ReactNode | true | - | It's your app\screen component that will be wrapped by MenuDrawer |

useMenuDrawer params:

| param | Type | Required | Default Value | | ----------------- | --------------- | -------- | ----------------- | | tapToClose | boolean | false | true | | position | 'left', 'right' | false | 'right' | | paddingGesture | number | false | 50 | | drawerWidth | number | false | width_screen*0.7 | | allowedSwipeWidth | number | false | width_screen*0.5 | | animationTime | number | false | 250 | | opacity | number | false | 0.35 | | backgroundColor | string | false | '#000' | | MenuContent | JSX.Element | true | - | | children | React.ReactNode | true | - |