JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q28836F
  • License MIT

Accessible dropdown (in React).

Package Exports

  • @bscop/react-dropdown

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-dropdown) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

react-dropdown

GitHub license npm version CircleCI Status Coverage

Accessible dropdown (in React).

Install

npm i @bscop/react-dropdown

Usage

import Dropdown from "@bscop/react-dropdown";

function App () {
  return (
    <Dropdown 
      label="Menu"
      role="menu"
    >
      <a role="menuitem" href="#">Account</a>
      <a role="menuitem" href="#">Messages</a>
      <a role="menuitem" href="#">Settings</a>
      <hr />
      <a role="menuitem" href="#logout">Logout</a>
    </Dropdown>
  );
}

CSS Custom properties

You can set the following CSS Custom properties to customize the look of the dropdown component:

:root {
  --main-color: black;
  --main-bg-color: white;
  --dropdown-border-color: #bababa;
}

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