# react-aria-menubutton **Repository Path**: mirrors_davidtheclark/react-aria-menubutton ## Basic Information - **Project Name**: react-aria-menubutton - **Description**: A fully accessible, easily themeable, React-powered menu button - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-08-08 - **Last Updated**: 2026-03-28 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # react-aria-menubutton [![Build Status](https://github.com/davidtheclark/react-aria-menubutton/actions/workflows/build.yml/badge.svg)](https://github.com/davidtheclark/react-aria-menubutton/actions) A fully accessible, flexible React menu button component with built-in **TypeScript support**. Provides keyboard interactions and ARIA attributes aligned with [the WAI-ARIA Menu Button Design Pattern](http://www.w3.org/TR/wai-aria-practices/#menubutton). Please check out [the demo](https://davidtheclark.github.io/react-aria-menubutton/demo/). ## Project Goals - Full accessibility - Maximum flexibility - Absolutely minimal styling - Thorough testing - Useful modularity "Useful modularity" means that when it makes sense, chunks of lower-level code that solve specific problems are split off into vanilla JS, framework-agnostic modules that could be shared with other similar projects (e.g. a menu button for Angular or Ember). For this library I was able to split off: - [focus-group](//github.com/davidtheclark/focus-group) - [teeny-tap](//github.com/davidtheclark/teeny-tap) *If you like this kind of module (accessible, flexible, unstyled, with framework-agnostic low-level modules) you should also check out these projects:* - [react-aria-modal](https://github.com/davidtheclark/react-aria-modal) - [react-aria-tabpanel](https://github.com/davidtheclark/react-aria-tabpanel) ### Accessibility The project started as an effort to build a React component that follows every detail of [the WAI-ARIA Menu Button Design Pattern](http://www.w3.org/TR/wai-aria-practices/#menubutton) for **maximum accessibility**. Just hiding and showing a menu is easy; but the required **keyboard interactions** are kind of tricky, the required **ARIA attributes** are easy to forget, and some other aspects of opening and closing the menu based on behaviors, and managing focus, proved less than pleasant. So I decided to try to abstract the component enough that it would be **worth sharing with others**. **If you think that this component could be even more accessible, please file an issue.** ### Letter Navigation When focus is on the menu button or within the menu and you type a letter key, a search begins. Focus will move to the first item that starts with the letter you typed; but if you continue to type more letters, the search string extends and the focus becomes more accurate. So if you type `f` focus might arrive at `farm`; but then if you keep typing until you've typed `foo`, focus will skip ahead (past `farm` and `fit` and `fog`) to `foot`. This significantly improves your ability to type your way to your intended selection. This keyboard interaction (as well as the home, end, and arrow keys) is enabled by the module [focus-group](//github.com/davidtheclark/focus-group). You can read more about the way letter navigation works [in that documentation](//github.com/davidtheclark/focus-group#string-searching). (In 3.x.x, when you typed a letter key focus moved to the next item in the menu (i.e. after the current focused item) that started with that letter, looping around to the front if if reached the end. This was more or less the suggested behavior from the ARIA suggestion and what I saw in jQuery UI. But I think the UX was insufficient, so when I separated out the letter navigation into the module [focus-group](//github.com/davidtheclark/focus-group), I tried to *improve letter navigation by more closely mimicking native `