Menu
Organize hierarchical navigation.
Basic usage
More examples
Controlled navigation and routing
Keep selectedKey in sync with the current route. Use linkRender to replace the default anchor with a React Router or Next.js Link, retaining its event handlers, classes and ARIA attributes.
Usage
The vertical menu defaults to 240px (60px when collapsed); use style.width to customize it. items supports nesting, groups, dividers and links. selectedKey controls the current item and openKeys controls expanded items. Horizontal and collapsed modes display submenus in floating panels.
Submenus animate in both directions, and the sidebar width transitions when collapsed. Closed items are excluded from keyboard navigation. Transitions are disabled when the system requests reduced motion.
Menu items, hover backgrounds and selection highlights share the base radius with buttons. Set ConfigProvider's theme.borderRadius to adjust them together, or use theme.components.Menu.borderRadius to customize the menu radius.
Types
Import these types for data, callbacks and refs.