You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-**buttonProps:** An object meant to be spread as properties on a `<button />` element.
77
+
-**onKeyDown:** A function which manages the behavior of your dropdown menu when a key is pressed while focused on the menu button.
78
+
-**onClick:** The same function as `onKeyDown()`, but its behavior differs somewhat for click events.
79
+
-**tabIndex:** Sets the tab index property of the `<button />` element.
80
+
-**ref:** A React ref applied to the `<button />` element, used to manage focus.
81
+
-**role:** A role property in accordance with WAI-ARIA guidelines.
82
+
-**aria-haspopup:** An ARIA attribute indicating this button has a related menu element.
83
+
-**aria-expanded:** An ARIA attribute indicating whether the menu is currently open.
84
+
-**itemProps:** An array of objects meant to be spread as properties on `<a />` elements that serve as menu items in your dropdown.
85
+
-**onKeyDown:** A function which manages the behavior of your dropdown menu when a key is pressed while focused on a menu item.
86
+
-**tabIndex:** Sets the tab index property to `-1` to prevent the browser's native focusing logic. Focus is managed programatically by this Hook.
87
+
-**role:** A role property in accordance with WAI-ARIA guidelines.
88
+
-**ref:** A React ref applied to each menu item, used to manage focus.
89
+
-**isOpen:** A boolean value indicating if the menu is open or closed. The developer should use this value to make the menu visible or not.
90
+
-**setIsOpen:** A function useful for allowing the developer to programmatically open/close the menu.
91
+
48
92
## Accessibility notes
49
93
Our team carefully studied and adhered to [Web Content Accessibility Guidelines 2.1](https://www.w3.org/WAI/standards-guidelines/wcag/) and [WAI-ARIA Authoring Practices 1.1](https://www.w3.org/TR/wai-aria-practices/) when designing this Hook. Here are some facets of accessibility that are handled automatically:
0 commit comments