@clipmx/menu

Menu related components

Stats

StarsIssuesVersionUpdatedCreatedSize
@clipmx/menu
0.0.102 years ago4 years agoMinified + gzip package size for @clipmx/menu in KB

Readme

Clip Menu

Installation

npm install @clipmx/menu --save

Usage

import React from 'react';
import Button from '@clipmx/button';
import Menu, { MenuItem } from '@clipmx/menu';

class MyComponent extends React.Component {
  state = { anchor: null };

  handleMenuOpen = e => this.setState({ anchor: e.target });

  handleMenuClose = () => this.setState({ anchor: null });

  render() {
    return (
      <div>
        <Button onClick={this.handleMenuOpen}>Open Menu</Button>
        <Menu
          anchorEl={this.state.anchor}
          open={Boolean(this.state.anchor)}
          onClose={this.handleMenuClose}
        >
          <MenuItem>Item 1</MenuItem>
          <MenuItem>Item 1</MenuItem>
          <MenuItem>Item 1</MenuItem>
        </Menu>
      </div>
    );
  }
}

export default MyComponent;

Props

This is a wrapper of the Material-UI Menu, so you can use any props that Material-UI supports.

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.