Socket
Book a DemoInstallSign in
Socket

rc-menu

Package Overview
Dependencies
Maintainers
2
Versions
281
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rc-menu

menu ui component for react

Source
npmnpm
Version
3.4.2
Version published
Weekly downloads
2.2M
-2.61%
Maintainers
2
Weekly downloads
 
Created
Source

rc-menu

react menu component. port from https://github.com/kissyteam/menu

NPM version build status Test coverage gemnasium deps node version npm download Sauce Test Status

Sauce Test Status

Screenshot

alt

Usage

var Menu = require('rc-menu');
var SubMenu = Menu.SubMenu;
var MenuItem = Menu.Item;
React.render(<Menu>
  <MenuItem>1</MenuItem>
  <SubMenu title="2">
  <MenuItem>2-1</MenuItem>
  </SubMenu>
</Menu>, container);

install

rc-menu

API

Menu props

nametypedefaultdescription
classNameStringadditional css class of root dom node
activeKeyObjectfirst active item's keysame with active tabPanel's key
activeFirstBooleanfalsewhether active first menu item when show if activeKey is not set
multipleBooleanfalsewhether allow multiple select
selectedKeysString[][]selected keys of items
onSelectfunction(key:String,child:ReactComponent)called when select a menu item
onDeselectfunction(key:String,child:ReactComponent)called when deselect a menu item
onSelectFunction(key:String)function called with selected menu item's key as param

Menu.Item props

nametypedefaultdescription
classNameStringadditional css class of root dom node
disabledBooleanfalseno effect for click or keydown for this item
keyObjectcorresponding to activeKey

Menu.SubMenu props

nametypedefaultdescription
classNameStringadditional css class of root dom node
titleString/ReactElementsub menu's content
keyObjectcorresponding to activeKey
disabledBooleanfalseno effect for click or keydown for this item
openOnHoverBooleantruewhether show second sub menu on hover

Menu.Divider props

none

Menu.ItemGroup props

nametypedefaultdescription
titleString|React.Elementtitle of item group
childrenReact.Element[]MenuItems belonged to this group

Development

npm install
npm start

Example

http://localhost:8001/examples/index.md

online example: http://react-component.github.io/menu/examples/

Test Case

http://localhost:8000/tests/runner.html?coverage

Coverage

http://localhost:8000/node_modules/rc-server/node_modules/node-jscover/lib/front-end/jscoverage.html?w=http://localhost:8000/tests/runner.html?coverage

License

rc-menu is released under the MIT license.

Keywords

react

FAQs

Package last updated on 15 Jul 2015

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