@bscop/react-menu
v1.1.2
Published
Accessible menu (in React).
Downloads
4
Maintainers
Readme
react-menu
Accessible menu (in React).
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