React-Menu
React component for building accessible menu, dropdown, submenu, context me...
README
React-Menu
An accessible and keyboard-friendly React menu library.
Features
- React menu components for easy and fast web development.
- Unlimited levels of submenu.
- Supports dropdown, hover, and context menu.
- Supports radio and checkbox menu items.
- Flexible menu positioning.
- Comprehensive keyboard interactions.
- Unstyled components and easy customisation.
- Optimal level support (level 3) ofReact 18 concurrent rendering.
- Supports server-side rendering.
- WAI-ARIA Authoring Practices compliant.
Install
with npm
- ```bash
- npm install @szhsin/react-menu
- ```
or with Yarn
- ```bash
- yarn add @szhsin/react-menu
- ```
Usage
- ```jsx
- import { Menu, MenuItem, MenuButton, SubMenu } from '@szhsin/react-menu';
- export default function App() {
- return (
- <Menu menuButton={<MenuButton>Open menu</MenuButton>}>
- <MenuItem>New File</MenuItem>
- <MenuItem>Save</MenuItem>
- <SubMenu label="Edit">
- <MenuItem>Cut</MenuItem>
- <MenuItem>Copy</MenuItem>
- <MenuItem>Paste</MenuItem>
- </SubMenu>
- <MenuItem>Print...</MenuItem>
- </Menu>
- );
- }
- ```
**[Visit more examples and docs](https://szhsin.github.io/react-menu/)**
**[FAQs](docs/FAQs.md)**
Still on older versions? Please checkout our migration guides.
License
MIT Licensed.