New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-native-section-menu

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-section-menu

A multi-platform React Native sectioned menu

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
increased by300%
Maintainers
1
Weekly downloads
 
Created
Source

react-native-section-menu

Build Status

A multi-platform React Native sectioned menu.

iOS menu Android menu

Installation

$ npm i --save-dev react-native-section-menu

Usage

To render a basic menu, take the following code as an example. It will render a green header in Android with a drawer-based animation and a TabBar navigation for iOS. You can combine this component with react-native-vector-icons to fully customize the icons of your menu.

import { Menu } from 'react-native-section-menu'

class MyMenu extends React.Component {
  render () {
    return (
      <Menu
        header={<View style={{height: 150, backgroundColor: '#27ae60'}} />}
        initialEntry={0}
        tintColor='#27ae60'
        entries={[
          {
            id: 0,
            element: <View style={{flex: 1, backgroundColor: '#95a5a6'}} />,
            title: 'Bookmarks',
          },
          {
            id: 1,
            element: <View style={{flex: 1, backgroundColor: '#2c3e50'}} />,
            title: 'Contacts',
          },
          {
            id: 2,
            element: <View style={{flex: 1, backgroundColor: '#ecf0f1'}} />,
            title: 'Search',
          }
        ]}
      />
    )
  }
}

API

Required

PropTypeDescription
entriesArray<Entry>An array of menu entries.
Entry object
PropTypeDescription
idnumberA numeric identifier.
titlestringThe title of the section.
elementelementThe element to render in the section.

Not required

PropTypeDescription
initialEntrynumberA number to mark the entry to render by default.

iOS specific

PropTypeDescription
TabBarIOS.propTypesYou can pass all the props. Docs here.
Entry object
PropTypeDescription
itemComponentfuncPass here Icon.TabBarItemIOS to use react-native-vector-icons TabBar item.
iconNamestringThe react-native-vector-icons icon name.
selectedIconNamestringThe react-native-vector-icons selected icon name.
iconSizenumberThe react-native-vector-icons icon size.

Android specific

PropTypeDescription
DrawerLayoutAndroid.propTypesDrawerLayoutAndroid available props.
containerStyleView.propTypes.styleThe style of the parent container view.
headernodeOptional header to display above the menu list.
Entry object
PropTypeDescription
androidIconnodeA React node to render as an icon.
androidBackgroundTouchableNativeFeedback.propTypes.backgroundThe background effect of the entry section.
tintColorstringThe tint color of the selected entry.

License

MIT

How to contribute

Please open an issue or send a PR ☺️.

Authors

Álvaro Medina Ballester amedina at apsl.net.

Dani Sastre sastred at apsl.net

Keywords

FAQs

Package last updated on 29 Sep 2016

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