Menu

Component for creating menus through a list of items, or composition using the Menu and MenuItem components.

Props

ref_id String

Id of the element in the DOM after component rendering.

default: ''

items Array

List of items for each button appears on the menu. See the component documentation Button.

default: []
items: [
  {
    text: 'Item 1',
    href: '#'
  },
  {
    text: 'Item 2',
    href: '#'
  },
  {
    text: 'Item 3',
    href: '#'
  }
]

Creating menus for composition

A menu can be created by composition by MenuItem subcompoentes passed as children menu. A custom menu using Menu and MenuItem can be implemented as in the example below.

var CustomMenu = React.createClass({
  render: function() {
    return (
      <Menu>
        <MenuItem text="Item 1" href="#" />
        <MenuItem text="Item 2" href="#" />
        <MenuItem text="Item 3" href="#" />
      </Header>
    );
  }
});