Package Exports
- rc-menu
- rc-menu/assets/index.css
- rc-menu/lib/MenuItem
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (rc-menu) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
rc-menu
react menu component. port from https://github.com/kissyteam/menu
Screenshot
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
API
menu props
name | type | default | description |
---|---|---|---|
className | String | additional css class of root dom node | |
activeKey | Object | first active item's key | same with active tabPanel's key |
activeFirst | Boolean | false | whether active first menu item when show if activeKey is not set |
multiple | Boolean | false | whether allow multiple select |
selectedKeys | String[] | [] | selected keys of items |
onSelect | function(key:String,child:ReactComponent) | called when select a menu item | |
onDeselect | function(key:String,child:ReactComponent) | called when deselect a menu item | |
onSelect | Function(key:String) | function called with selected menu item's key as param |
menu item props
name | type | default | description |
---|---|---|---|
className | String | additional css class of root dom node | |
disabled | Boolean | false | no effect for click or keydown for this item |
key | Object | corresponding to activeKey |
sub menu props
name | type | default | description |
---|---|---|---|
className | String | additional css class of root dom node | |
title | String/ReactElement | sub menu's content | |
key | Object | corresponding to activeKey | |
disabled | Boolean | false | no effect for click or keydown for this item |
openOnHover | Boolean | true | whether show second sub menu on hover |
Development
npm install
npm start
Example
http://localhost:8001/examples/index.md
online example: http://spmjs.io/docs/rc-menu/examples/
Test Case
http://localhost:8000/tests/runner.html?coverage
Coverage
License
rc-menu is released under the MIT license.