JSPM

@bscop/react-menu

1.1.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3
  • Score
    100M100P100Q27745F
  • License MIT

Accessible menu (in React).

Package Exports

  • @bscop/react-menu

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@bscop/react-menu) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

react-menu

GitHub license npm version CircleCI Status Coverage

Accessible menu (in React).

View in Storybook.

Install

npm i @bscop/react-menu

Usage

import Menu from "@bscop/react-menu";

function App () {
  return (
    <Menu 
      items={
        [
          [
            {
              href: "#account",
              id: "account",
              label: "Account",
            },
            {
              href: "#preferences",
              id: "preferences",
              label: "Preferences",
            },
            {
              href: "#billing",
              id: "billing",
              label: "Billing",
            },
          ],
          [
            {
              id: "logout",
              label: "Logout",
              renderItem (baseProps) {
                return (
                  <form action="/logout" method="post">
                    <button {...baseProps} type="submit">
                      Logout
                    </button>
                  </form>
                );
              },
            },
          ],
        ]
      }
      label="Menu"
    />
  );
}

Contribute

Read the guidelines.

Run tests

npm test

Coverage

Coverage reports are hosted on codecov.

npm run badge:coverage -- --token=<guid>

Bruno Scopelliti
www.brunoscopelliti.com