Menu

Menus allow users to select a single item from a group of available options.

Simple

A simple example of menu.

Collapsable menu item

Menus can contain nested levels as collapsable menu items.

Disabled menu item

Menu items can be disabled to prevent a user from interacting with them.

Default active

We can set the menu items within to active by entering corresponded eventKey to defaultActiveKeys

Default expand

We can expand the collapsable menu items within by entering corresponded eventKey to defaultExpandedKeys

API

Menu
PropDescriptionTypeDefault
defaultActiveKeysInitial set menu item as active based on inserted keys which corresponding to eventkeystring[][]
defaultCollapseActiveKeysInitial collapsable menu item active based on inserted keys which corresponding to eventkeystring[][]
defaultExpandedKeysInitial expand collapsable menu item based on inserted keys which corresponding to eventkeystring[][]
menuItemHeightHeight of all menu itemstring | number40
onSelectCallback when menu item clicked(e: MouseEvent, eventKey: string) => void-
sideCollapsedWhether to side collapse the menubooleanfalse
variantThe variants of the menu.'light' | 'dark' | 'themed' | 'transparent''light'
Menu.MenuCollapse
PropDescriptionTypeDefault
activeWhether to highlight the collapsable menu itembooleantrue
eventKeyAn unique value for the collapsable menu itemstring-
expandedWhether to expand current collpased menu itembooleanfalse
indentWhether to indent child menu itembooleantrue
labelContent of the collpased menu itemstring | ReactNode-
onToggleCallback when collpased menu item toggled(expanded: boolean, e: MouseEvent) => void-
Menu.MenuGroup
PropDescriptionTypeDefault
labelContent of the collpased menu group titlestring | ReactNode-
Menu.MenuItem
PropDescriptionTypeDefault
asElementRender elementstring'div'
disabledWhether to disable menu itemboolean-
dotIndentWhether show dot as prefix in menu itemboolean-
eventKeyAn unique value for the menu itemboolean-
isActiveWhether to active menu itemboolean-
menuItemHeightHeight of menu itemstring | number40
onSelectCallback menu item clicked(eventKey: string, e: MouseEvent) => void40