Giter Site home page Giter Site logo

wrathchaos / react-native-bottom-menu Goto Github PK

View Code? Open in Web Editor NEW
18.0 3.0 2.0 17.21 MB

Fully customizable Bottom Menu for React Native.

Home Page: https://www.freakycoder.com

License: MIT License

JavaScript 45.56% Java 9.67% Ruby 12.49% Objective-C 22.07% Starlark 10.21%
react reactjs react-native jsx design ios mobile mobile-app-development application library

react-native-bottom-menu's Introduction

React Native Bottom Menu

Battle Tested โœ…

Fully customizable Bottom Menu for React Native

npm version npm Platform - Android and iOS License: MIT styled with prettier

React Native Bottom Menu React Native Bottom Menu

Installation

Add the dependency:

React Native:

npm i react-native-bottom-menu

Peer Dependencies

IMPORTANT! You need install them.
"react": ">= 16.x.x",
"react-native": ">= 0.55.x",
"react-native-androw": ">= 0.0.31",
"react-native-vector-icons": ">= 6.x.x",
"react-native-dynamic-vector-icons": ">= x.x.x"

Basic Usage

You can use any other component rather than Item component. It's all customizable.

import { BottomMenu, Item } from "react-native-bottom-menu";
<BottomMenu>
  <Item
    size={22}
    name="home"
    text="Home"
    type="Octicons"
    onPress={() => {})}
  />
</BottomMenu>

Advanced Usage

You can check the example for the advanced usage

<BottomMenu>
  <Item
    size={22}
    name="home"
    text="Home"
    type="Octicons"
    isActive={this.state.isActive == "home" ? true : false}
    onPress={() => this.setState({ isActive: "home" })}
  />
  <Item
    size={22}
    type="Feather"
    text="Messages"
    name="message-circle"
    isActive={this.state.isActive == "messages" ? true : false}
    onPress={() => this.setState({ isActive: "messages" })}
  />
  <Item
    size={30}
    name="cart"
    text="Cart"
    type="EvilIcons"
    isActive={this.state.isActive == "cart" ? true : false}
    onPress={() => this.setState({ isActive: "cart" })}
  />
  <Item
    size={22}
    name="settings"
    text="Settings"
    type="SimpleLineIcons"
    isActive={this.state.isActive == "settings" ? true : false}
    onPress={() => this.setState({ isActive: "settings" })}
  />
</BottomMenu>

BottomMenu Wrapper with React Hooks as an Example

import React, { useState } from "react";
import { BottomMenu, Item } from "react-native-bottom-menu";

const BottomMenuWrapper = props => {
  const [isActive, setActive] = useState("home");
  return (
    <BottomMenu>
      <Item
        size={22}
        name="home"
        text="Home"
        type="Octicons"
        isActive={isActive == "home" ? true : false}
        onPress={() => setActive("home")}
      />
      <Item
        size={22}
        type="Feather"
        text="Messages"
        name="message-circle"
        isActive={isActive == "messages" ? true : false}
        onPress={() => setActive("messages")}
      />
      <Item
        size={30}
        name="cart"
        text="Cart"
        type="EvilIcons"
        isActive={isActive == "cart" ? true : false}
        onPress={() => setActive("cart")}
      />
      <Item
        size={22}
        name="settings"
        text="Settings"
        type="SimpleLineIcons"
        isActive={isActive == "settings" ? true : false}
        onPress={() => setActive("settings")}
      />
    </BottomMenu>
  );
};

export default BottomMenuWrapper;

Usage

import BottomMenu from "shared-components/BottomMenuWrapper";

<BottomMenu />

ToDos

  • LICENSE
  • Write an article about the lib on Medium

Author

FreakyCoder, [email protected]

License

React Native Bottom Menu Library is available under the MIT license. See the LICENSE file for more info.

react-native-bottom-menu's People

Contributors

dependabot-preview[bot] avatar dependabot[bot] avatar wrathchaos avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

walp-io agunnamdi

react-native-bottom-menu's Issues

Shadow (elevation) not working in Android platform

I'm using react-native-bottom-menu 0.1.8 and I'm having some problem to set shadow in the menu element on android platform. I have tried to add elevation: 5 in the menu shadowStyle but still not works...

Android at left and iOS at right:
image

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.