Skip to content

Latest commit

 

History

History
37 lines (31 loc) · 1015 Bytes

README.md

File metadata and controls

37 lines (31 loc) · 1015 Bytes

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.