# menu

- 分组：组合组件（Composite）
- 页面：/components/menu
- 源码：packages/react/src/components/menu.tsx

## 导出

```ts
import { Menu } from "@modra/react";
```

## Props（MenuProps）

| 名称 | 必填 | 类型 | 说明 |
| --- | --- | --- | --- |
| `items` | 否 | `MenuItemType[]` |  |
| `mode` | 否 | `MenuMode` |  |
| `selectedKeys` | 否 | `string[]` |  |
| `defaultSelectedKeys` | 否 | `string[]` |  |
| `openKeys` | 否 | `string[]` |  |
| `defaultOpenKeys` | 否 | `string[]` |  |
| `multiple` | 否 | `boolean` |  |
| `inlineCollapsed` | 否 | `boolean` | Icon-only inline menu. When omitted, a Menu inside a `Layout.Sider` follows the sidebar's collapsed state; an explicit value always wins. |
| `inlineIndent` | 否 | `number` | Indent per level in px for inline menus. Defaults to the `--component-menu-inline-indent` token. |
| `overflow` | 否 | `MenuOverflow` |  |
| `theme` | 否 | `MenuTheme` | `dark` renders on the sidebar surface (sidebar tokens). Defaults to the theme of the enclosing Layout.Sider, or light outside of one. |
| `overflowedIndicator` | 否 | `React.ReactNode` |  |
| `triggerSubMenuAction` | 否 | `"click" \| "hover"` |  |
| `onClick` | 否 | `(info: MenuInfo) => void` |  |
| `onSelect` | 否 | `(info: MenuInfo) => void` |  |
| `onOpenChange` | 否 | `(openKeys: string[]) => void` |  |
| `highlightActiveAncestors` | 否 | `boolean` | Marks submenu triggers that contain a selected item with `data-active-ancestor` and a subtle accent background, so the selected item's section stays visible when it is closed or the menu is collapsed. Defaults to true. |
| `onCollapsedGroupClick` | 否 | `(info: MenuInfo) => void` | Called when a submenu trigger is activated while the inline menu is collapsed. When set (or when the menu sits in an AppShell sidebar that expands itself), the submenu is added to the open keys instead of opening a flyout, so the caller can expand the sidebar and show it inline. |
| `disabled` | 否 | `boolean` |  |
