@sensilla-cloud/react-context-menu
v1.1.0
Published
A react component for custom context menus
Downloads
6
Maintainers
Readme
react-context-menu
A react component for custom context menus. Designed to be dropped in and used.
There is no included styles, however, the stories
directory contains the scss used for the stories and can be used as a good starting point.
The menu handles placement even when close to the edge of the screen and sub-menus can be nested.
Quick Start
import ContextMenu from '@sensilla-cloud/react-context-menu';
<ContextMenu items={[
<span>Item 1</span>,
<span>Item 2</span>
]}
className="context-menu">
<div
style={{
width: 300,
height: 300,
backgroundColor: '#222',
color: '#fff',
textAlign: 'center',
lineHeight: '300px',
marginLeft: 'auto',
marginRight: 'auto'
}}
>
Right-click Me!
</div>
</ContextMenu>
Check out the storybook to see everything that is possible.
License
This library is licensed under the MIT license.