Search code examples
reactjsoffice-ui-fabricreact-tsxoffice-ui-fabric-react

How to change default icon of a ContextualMenu


Referring to examples of ContextualMenu in https://developer.microsoft.com/en-us/fabric#/controls/web/contextualmenu, I want to change the default icon (ChevronDown) to ChevronUp. How do I do that? I tried a few options by providing a styles variable with desired icon and no success yet. Any ideas on how to do this?


Solution

  • You can use menuIconProps prop of the office ui fabric Button component to change the icon.

    <Button menuIconProps={{ iconName:"MoreVertical" }} menuProps={{ items:[]}}>
       Click Me
    </Button>