4.0.5 • Published 3 years ago

@kenshooui/react-menu v4.0.5

Weekly downloads
757
License
MIT
Repository
github
Last release
3 years ago

React Menu

Build Status npm version

Kenshoo menu component

react-menu demo

React menu is a simple menu container component that helps a user create a simple menu bar

Installation

Installation using npm:

 npm install @kenshooui/react-menu --save

Installation using Yarn:

 yarn add @kenshooui/react-menu

How to use

import React, { Component } from "react";
import Menu, {
    Button, 
    Dropdown, 
    Seperator, 
    DropdownItem, 
} from ""@kenshooui/react-menu";

class Menu extends Component {
  render() {
     <Menu>
            <Button>Analysis</Button>
            <Dropdown label="options">
                <DropdownItem>option 1</DropdownItem>
                <DropdownItem>Option 2/DropdownItem>
            </Dropdown>
            <Separator />
            <Button>Help</Button>
            <Dropdown label="more options">
                <DropdownItem>option 1</DropdownItem>
                <DropdownItem>Option 2</DropdownItem>
            </Dropdown>
            <div>I'm a div</div>
        </Menu>
  }
}

Properties

Menu

NameTypeDefaultDescription
classNameString''Used for customizing the style.
childrenElements/Components''List of elements to place in the menu

Button

NameTypeDefaultDescription
classNameString''Used for customizing the style.
disabledClassNameString''Used for customizing the disabled style.
childrenElements/Components''List of elements to place in the menu
isDisabledboolean''Toggle to disable/enable the component.
onClickfunction''The click callback function.

Dropdown

NameTypeDefaultDescription
classNameString''Used for customizing the style.
disabledClassNameString''Used for customizing the disabled style.
itemsClassNameString''Used for customizing the items container style.
iconClassNameString''Used for customizing the chevron icon.
labelString''The dropdown label
childrenElements/Components''List of elements to place in the menu
isDisabledboolean''Toggle to disable/enable the component.
withIconboolean'true'Toggle to display/hide arrow icon next to the dropdown title.
onClickfunction''The click callback function.
directionString''bottom, right, right_to_top, left, left_to_top, bottom_left - default uses bottom style.

Seperator

Use this component to divide the menu to left and right sections

NameTypeDefaultDescription
classNameString''class name - Used for customizing the style.

How to Contribute

Setting up development environment

  1. Fork the repository and create your branch from master.
  2. Install the project: yarn install
  3. Run tests: yarn test or yarn test:watch
  4. Run dev environment: yarn storybook and head to https://localhost:6006

Issuing a change

  1. Push to github.
  2. If you’ve fixed a bug or added code that should be tested, add tests.
  3. Open a Pull Request with the following guidelines:
    • Set title prefix to feature/bug and supply a descriptive PR title.
    • Add description to your Pull Request describing your change.
  4. Once your Pull Request is issued, the test suite and build processes will run and your change will be reviewed.

Compatibility

  • React 16 or newer

4.0.5

3 years ago

4.0.4

3 years ago

4.0.3

3 years ago

4.0.2

3 years ago

4.0.1

4 years ago

4.0.0

4 years ago

3.0.2

4 years ago

3.0.1

4 years ago

3.0.0

5 years ago

2.0.2

5 years ago

2.0.1

5 years ago

2.0.0

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago