@bscop/react-dropdown
v1.4.0
Published
Accessible dropdown (in React).
Downloads
17
Maintainers
Readme
react-dropdown
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