Search code examples
javascriptreactjswebmaterial-designreact-toolbox

How to use text instead of Icon for react-toolbox menu?


I am using react-toolbox menu for my website. Based on the example given in the documentation React-toolbox menu, I can only use icon as my menu. How can I use text for the menu instead?

Example of what I want to do:

When I click the blog text which is a menu, the menuItem will be shown.

Example

Is it possible to do this?


Solution

  • just remove icon property from MenuItem component

     <IconMenu icon={<div>blog</div>} position='topLeft' menuRipple>
      <MenuItem value='download' caption='Download' />
      <MenuItem value='help' caption='Favorite' />
      <MenuItem value='settings' caption='Open in app' />
      <MenuDivider />
      <MenuItem value='signout' icon='delete' caption='Delete' disabled />
     </IconMenu>