Skip to main content

Menu

PropRequiredDefaultTypeDescripton
idstring | numberUnique id to identify the menu
childrenReactNodeAny valid node which can be rendered
themestringTheme is appended to
  • contexify_theme-${given theme}
animationscalestringAnimation appended to
  • contexify_willEnter-${given animation}
  • contexify_willLeave-${given animation}
onShown() => voidInvoked after the menu appeared
onHidden() => voidInvoked after the menu has been hidden
any HTML AttributeHTMLAttributeAny valid HTML attribute
import { Menu, Item } from "react-contexify";

<Menu
id="anId"
theme="dark"
animation="scale"
>
<Item>item 1</Item>
<Item>item 2</Item>
{/* etc... */}
</Menu>

HTMLAttribute

<Menu 
id="anId"
data-test="item-1"
className="a-css-class"
style={{ color: "purple" }}
>
<Item>item 1</Item>
<Item>item 2</Item>
{/* etc... */}
</Menu>