To start using react-accessible-menu, install it to your project as a dependency via
npm install react-accessible-menu
then import it and add your menu with
import { Menu, MenuItem } from 'react-accessible-menu';
<Menu
renderMenu={({ props, ref }) => (
<div className="list" ref={ref} {...props}>
<MenuItem<HTMLButtonElement>
renderItem={({ props, ref, }) => (
<button {...props} ref={ref} className="item">
Apple
</button>
)}
/>
<MenuItem<HTMLButtonElement>
renderItem={({ props, ref, }) => (
<button {...props} ref={ref} className="item">
Orange
</button>
)}
/>
</div>
)}
/>
You can find more examples in the Project's Storybook.