@react-lit/menu-button
v0.7.0
Published
An accessible dropdown menu for the common dropdown menu button design pattern.
Downloads
3
Readme
@react-lit/menu-button
An accessible dropdown menu for the common dropdown menu button design pattern.
Installation
$ npm i @react-lit/menu-button
# or
$ yarn add @react-lit/menu-button
Example
import * as React from 'react';
import {
Menu,
MenuList,
MenuButton,
MenuItem,
MenuLink,
} from "@react-lit/menu-button";
function Example() {
return (
<Menu>
<MenuButton>
Actions <span aria-hidden>▾</span>
</MenuButton>
<MenuList>
<MenuItem onSelect={() => console.log("Download")}>Download</MenuItem>
<MenuItem onSelect={() => console.log("Copy")}>Create a Copy</MenuItem>
<MenuLink as="a" href="https://github.com/joelvoss/react-lit-menu-button">
Go to website
</MenuLink>
</MenuList>
</Menu>
);
}
Development
(1) Install dependencies
$ npm i
# or
$ yarn
(2) Run initial validation
$ ./Taskfile.sh validate
(3) Run tests in watch-mode to validate functionality.
$ ./Taskfile test -w
This project was set up by @jvdx/core