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

react-native-side-nav

v2.0.3

Published

A simple side drawer for React Native, with an optional Burger Icon.

Downloads

5

Readme

react-native-side-nav

platforms Package version PRs Welcome npm downloads License: MIT TypeScript

Contents

Usage

import React from "react";
import { View, TouchableOpacity } from "react-native";
import SideMenu from "react-native-side-nav";

const MenuComponent = () => {
  return <View style={styles.animatedBox}>
         // Your menu content here
         </View>;
};

const App = () => {
  const [menuExpanded, setMenuExpanded] = useState(false);

  return (
    <View>
      <SideMenu
        menuExpanded={menuExpanded}
        menuComponent={<MenuComponent />}
        burgerIcon
        onToggle={() => setMenuExpanded(!menuExpanded)}
      >
        // Your App components
      </SideMenu>
    </View>
  );
};

export default App;

Props

| Prop | Default | Type | Description | | :--------------------------------------- | :-------: | :---------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | menuExpanded | false | boolean | Set to true or false to open or close the menu. | | menuComponent | | ReactNode | The content of your drawer. (see example) | | menuWidth optional | 80 | number | The width of the menu, as a percentage of the screen width. | | animationDuration optional | 300 | number | The length of the animation in ms. | | fade optional | false | boolean | Set to true to make the menu fade in on top of the content. Only works if push is set to false. | | overlay optional | false | boolean | Set to true adds a dark overlay on top of the app when the menu is open. | | overlayOpacity optional | 0.4 | number | Sets the opacity of the overlay. Only works if overlay is set to true. | | leftAligned optional | false | boolean | Set to true to make the menu come in from the left side of the screen. | | push optional | false | boolean | Set to true to make the menu 'push' your app contents to one side. | | burgerIcon optional | false | boolean | Set to true to add an absolutely positioned burger icon to toggle your menu. | | onToggle required if burgerIcon={true} | null | () => any | Your toggle function for the burger icon. (see example) | | onHide optional | null | () => any | The menu's hide function, pass this down if you want users to be able to close the menu by tapping outside of it. Ex onHide={() => setShow(false) | | burgerWidth optional | 35 | number | The width of the burger icon. | | burgerIconStyles optional | {} | ViewStyle | Edit the burger X and Y position. Example: burgerIconStyles={{top: 30, left: 20}}. You can try passing other styles although they haven't been tested. Use the burger icon color props instead. | | burgerIconColor1 optional | '#ffffff' | string | The color you want your burger icon to be. | | burgerIconColor2 optional | '' | string | If the background of your menu doesn't match the rest of your app, you can change the color of the icon when the menu is expanded. If you don't set this value it will default to burgerIconColor1. |

Examples

menuWidth

fade

overlay & overlayOpacity

leftAligned

push

burgerIcon

burgerWidth

burgerIconStyles

burgerIconColor1

burgerIconColor2

Roadmap

  • [ ] Improve animation
  • [ ] Android support
  • [ ] Update docs examples
  • [x] Typescript
  • [x] Add burger icon
  • [x] Testing
  • [x] Add overlay opacity prop

Questions

Feel free to contact me or create an issue

Made with ♥.