Flutter docs
Default skin

Menu

A navigation menu for pages and operations.

When to use

Use Menu for persistent top-level, inline, collapsed, vertical, or themed navigation structures.

Examples

Top Navigation

Horizontal top navigation menu.

Inline menu

Vertical menu with inline submenus.

Collapsed inline menu

Inline menu could be collapsed. Here is a complete demo with sider layout.

Menu tooltip

Configure tooltip in inline collapsed mode, or disable it.

Open current submenu only

Click the menu and you will see that all the other menus gets collapsed to keep the entire menu compact.

Vertical menu

Submenus open as pop-ups.

Menu Themes

There are two built-in themes: light and dark. The default value is light.

Sub-menu theme

You can config SubMenu theme with theme prop to enable different theme color effect. This sample is dark for root and light for SubMenu.

Switch the menu type

Show the dynamic switching mode (between inline and vertical).

Custom semantic dom styling

You can customize the semantic dom style of Menu by passing objects/functions through classNames and styles.

Custom Submenu Render

Use the popupRender prop to customize submenu popup rendering.

API

Menu, Menu.Item, Menu.SubMenu, Menu.ItemGroup, and their props are exported from @ceebee/ui/client.

Menu

PropertyDescriptionTypeDefaultVersion
classNamesCustomize class for each semantic structure inside the component. Supports object or function.Record<SemanticDOM, string> | (info: { props }) => Record<SemanticDOM, string>-—
defaultOpenKeysArray with the keys of default opened sub menusstring\[]-—
defaultSelectedKeysArray with the keys of default selected menu itemsstring\[]-—
expandIconcustom expand icon of submenuReactNode | (props: SubMenuProps & { isSubMenu: boolean }) => ReactNode-4.9.0
forceSubMenuRenderRender submenu into DOM before it becomes visiblebooleanfalse—
inlineCollapsedSpecifies the collapsed status when menu is inline modeboolean-—
inlineIndentIndent (in pixels) of inline menu items on each levelnumber24—
itemsMenu item content[ItemType\[\]](#itemtype)-4.20.0
modeType of menuvertical | horizontal | inlinevertical—
multipleAllows selection of multiple itemsbooleanfalse—
openKeysArray with the keys of currently opened sub-menusstring\[]-—
overflowedIndicatorCustomized the ellipsis icon when menu is collapsed horizontallyReactNode<EllipsisOutlined />—
selectableAllows selecting menu itemsbooleantrue—
selectedKeysArray with the keys of currently selected menu itemsstring\[]-—
stylesCustomize inline style for each semantic structure inside the component. Supports object or function.Record<SemanticDOM, CSSProperties> | (info: { props }) => Record<SemanticDOM, CSSProperties>-—
subMenuCloseDelayDelay time to hide submenu when mouse leaves (in seconds)number0.1—
subMenuOpenDelayDelay time to show submenu when mouse enters, (in seconds)number0—
tooltipConfig tooltip props for menu items in inline collapsed mode. Set to false to disable.false | TooltipProps-6.3.0
themeColor theme of the menulight | darklight—
triggerSubMenuActionWhich action can trigger submenu open/closehover | clickhover—
onClickCalled when a menu item is clickedfunction({ key, keyPath, domEvent, itemData })-—
onDeselectCalled when a menu item is deselected (multiple mode only)function({ key, keyPath, selectedKeys, domEvent, itemData })-—
onOpenChangeCalled when sub-menus are opened or closedfunction(openKeys: string\[])-—
onSelectCalled when a menu item is selectedfunction({ key, keyPath, selectedKeys, domEvent, itemData })-—
popupRenderCustom popup renderer for submenu(node: ReactElement, props: { item: SubMenuProps; keys: string[] }) => ReactElement-—

ItemType

PropertyDescriptionTypeDefaultVersion
dangerDisplay the danger stylebooleanfalse—
disabledWhether menu item is disabledbooleanfalse—
extraThe extra of the menu itemReactNode-5.21.0
iconThe icon of the menu itemReactNode-—
keyUnique ID of the menu itemstring-—
labelMenu labelReactNode-—
titleSet display title for collapsed itemstring-—
childrenSub-menus or sub-menu items[ItemType\[\]](#itemtype)-—
disabledWhether sub-menu is disabledbooleanfalse—
iconIcon of sub menuReactNode-—
keyUnique ID of the sub-menustring-—
labelMenu labelReactNode-—
popupClassNameSub-menu class name, not working when mode="inline"string-—
popupOffsetSub-menu offset, not working when mode="inline"\[number, number]-—
themeColor theme of the SubMenu (inherits from Menu by default)light | dark-—
onTitleClickCallback executed when the sub-menu title is clickedfunction({ key, domEvent })-—
popupRenderCustom popup renderer for current sub-menu(node: ReactElement, props: { item: SubMenuProps; keys: string[] }) => ReactElement-—
childrenSub-menu items[MenuItemType\[\]](#menuitemtype)-—
labelThe title of the groupReactNode-—
dashedWhether line is dashedbooleanfalse—