AppBar on front page http://www.material-ui.com/#/components/appbar not working
When I copy and paste the code below as is, I receive an error
<AppBar
title="Title"
iconElementLeft={<IconButton><NavigationClose /></IconButton>}
iconElementRight={
<IconMenu iconButtonElement={
<IconButton><MoreVertIcon /></IconButton>
}>
<MenuItem primaryText="Refresh" />
<MenuItem primaryText="Help" />
<MenuItem primaryText="Sign out" />
</IconMenu>
} />

Even after specifying an index for each MenuItem, I still receive the following error:

I suspect MoreVertIcon returning null to be the cause of this issue - could you please look into this?
@vmaudgalya can you please show your includes...
I'm importing the elements like this:
import { AppBar, IconButton, NavigationClose, MenuItem, IconMenu, MoreVertIcon } from 'material-ui'
Upon looking into the source, it seems that MoreVertIcon is actually being exported as NavigationMoreVert https://github.com/callemall/material-ui/blob/master/src/svg-icons/navigation/more-vert.jsx
NavigationClose is an icon not a material-ui component do
var NavigationClose = require('material-ui/lib/svg-icons/navigation/close.js');
import React from 'react';
import { AppBar, IconButton, MenuItem, IconMenu, MoreVertIcon } from 'material-ui'
var NavigationClose = require('material-ui/lib/svg-icons/navigation/close.js');
export default React.createClass({
render() {
return (
<AppBar
title="Title"
iconElementLeft={<IconButton><NavigationClose /></IconButton>}
iconElementRight={
<IconMenu iconButtonElement={
<IconButton><MoreVertIcon /></IconButton>
}>
<MenuItem primaryText="Refresh" index={0} />
<MenuItem primaryText="Help" index={1} />
<MenuItem primaryText="Sign out" index={2} />
</IconMenu>
} />
);
}
});
I'm still receiving this error:

Same for MoreVertIcon
var MoreVertIcon = require('material-ui/lib/svg-icons/navigation/more-vert');
By the way MenuItem is deprecated for now use
var MenuItem = require('material-ui/lib/menus/menu-item');
By the way you can view the src of each doc components here: https://github.com/callemall/material-ui/tree/master/docs/src/app/components/pages/components
@frnk94 thank you so much!
@frnk94 and to anyone else who may look at this issue in the future
var injectTapEventPlugin = require("react-tap-event-plugin");
injectTapEventPlugin();
were required to make this work. In addition, I understand that MenuItem is deprecated, upon looking into the material-ui index.js file, on changing
MenuItem: require('./menu/menu-item'),
to
MenuItem: require('./menus/menu-item'),
This import:
import { AppBar, IconButton, IconMenu, MenuItem } from 'material-ui'
worked. Is this a bug or is this intended (because MenuItem is deprecated) ?
Is this a bug or is this intended (because MenuItem is deprecated) ?
It's not intended, have a look at https://github.com/callemall/material-ui/pull/2307 for more details.
@oliviertassinari thank you. I also was not aware that import imported all of the components in index.js, I simply used it over require because it made the code cleaner.
I would be more than happy to contribute to material-ui documentation on material-ui.com to assist in keeping the documentation up-to-date :smiley:
to assist in keeping the documentation up-to-date
Well, we are updating the way we render the documentation. This is a work in progress. For instance
- appbar: done
- avatar https://github.com/callemall/material-ui/pull/2407
- toolbar https://github.com/callemall/material-ui/pull/2415
If you want to work on a specific component, feed free to do it, this would help a lot :+1:!
@oliviertassinari this is great news to hear, happy to see the documentation moving in the right direction! One last comment - is this intended?

This issue is already solved. :tada:
On Mon, 7 Dec 2015, 22:25 Varun Maudgalya [email protected] wrote:
@oliviertassinari https://github.com/oliviertassinari this is great news to hear, happy to see the documentation moving in the right direction! One last comment - is this intended? [image: screen shot 2015-12-07 at 1 23 27 pm] https://cloud.githubusercontent.com/assets/12266146/11640142/e1a955ec-9ce5-11e5-9b69-1223d779ae60.png
— Reply to this email directly or view it on GitHub https://github.com/callemall/material-ui/issues/2414#issuecomment-162668496 .
@oliviertassinari I'm still seeing it.
Yes, that's because this issue is fixed on the master branch. But the doc site is reflecting the 0.13.4 version.
ES6 way to do this would be :
import MoreVert from 'material-ui/svg-icons/navigation/more-vert';
and using the component:
<IconMenu
{...props}
iconButtonElement={<IconButton><MoreVert/></IconButton>}
targetOrigin={{
horizontal: 'right',
vertical: 'top'
}}
@tomgron Please don't resurrect long closed issues with stray comments - it spams the maintainers.