@bscop/react-dropdown
TypeScript icon, indicating that this package has built-in type declarations

1.4.0 • Public • Published

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

Package Sidebar

Install

npm i @bscop/react-dropdown

Weekly Downloads

1

Version

1.4.0

License

MIT

Unpacked Size

55.6 kB

Total Files

11

Last publish

Collaborators

  • brunoscopelliti