Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

db-rc-menu

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

db-rc-menu

menu ui component for react

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
Maintainers
1
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

Screenshot

alt

Usage

import Menu, {SubMenu, MenuItem} from 'rc-menu';
ReactDOM.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
modeStringverticalone of ["vertical","horizontal","inline"]
activeKeyObjectinitial and current active menu item's key.
defaultActiveFirstBooleanfalsewhether active first menu item when show if activeKey is not set or invalid
multipleBooleanfalsewhether allow multiple select
selectableBooleantrueallow selecting menu items
selectedKeysString[][]selected keys of items
defaultSelectedKeysString[][]initial selected keys of items
openKeysString[][]open keys of SubMenuItem
defaultOpenKeysString[][]initial open keys of SubMenuItem
onSelectfunction({key:String, item:ReactComponent, domEvent:Event, selectedKeys:String[]})called when select a menu item
onClickfunction({key:String, item:ReactComponent, domEvent:Event, keyPath: String[]})called when click a menu item
onOpenChange(openKeys:String[]) => voidcalled when open/close sub menu
onDeselectfunction({key:String, item:ReactComponent, domEvent:Event, selectedKeys:String[]})called when deselect a menu item. only called when allow multiple
openSubMenuOnMouseEnterbooltruewhether enable top items to open on mouse enter
closeSubMenuOnMouseLeavebooltruewhether enable close submenu on mouse leave
openAnimation{enter:function,leave:function}|Stringanimate when sub menu open or close. see rc-animate for object type.
openTransitionStringcss transitionName when sub menu open or close

Menu.Item props

nametypedefaultdescription
classNameStringadditional css class of root dom node
disabledBooleanfalseno effect for click or keydown for this item
keyObjectcorresponding to activeKey
onMouseEnterFunction({eventKey, domEvent})
onMouseLeaveFunction({eventKey, domEvent})

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
onMouseEnterFunction({eventKey, domEvent})
onMouseLeaveFunction({eventKey, domEvent})
onTitleMouseEnterFunction({eventKey, domEvent})
onTitleMouseLeaveFunction({eventKey, domEvent})
onTitleClickFunction({eventKey, domEvent})

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

npm test
npm run chrome-test

Coverage

npm run coverage

open coverage/ dir

License

rc-menu is released under the MIT license.

Keywords

FAQs

Package last updated on 17 Aug 2017

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