Menu
Prop | Required | Default | Type | Descripton |
---|---|---|---|---|
id | ✅ | string | number | Unique id to identify the menu | |
children | ✅ | ReactNode | Any valid node which can be rendered | |
theme | string | Theme is appended to
| ||
animation | scale | string | Animation appended to
| |
onShown | () => void | Invoked after the menu appeared | ||
onHidden | () => void | Invoked after the menu has been hidden | ||
any HTML Attribute | HTMLAttribute | Any 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>