Boolean if the menu should no longer close when the page is resized. Instead, it'll automatically update its position within the viewport.
Boolean if the menu should not be closed when the page is scrolled. Instead, it'll automatically update its position within the viewport. You normally don't want to enable this prop as the menu won't close if the menu control element is no longer in the viewport.
The id of the control element that toggles the menu. This is required so
that the menu can be positioned to this element and is normally a
<button>
.
The element that should be focused first when opened. This can either be the first or last focusable item in the menu, or a query selector string to find an element.
Boolean if the menu should be rendered horizontally instead of vertically.
The id for the menu. This is required for a11y.
Boolean if the portal should be used.
Optional options to pass down to the useFixedPositionin
hook styles to
change how the menu is fixed to the MenuButton
.
Boolean if the menu is currently visible.
A function to call that should set the visible
prop to false.
Generated using TypeDoc
The positioning anchor for the menu relative to the button/control that owns the menu. This is used for the positioning logic as well as modifying the animationg slightly to originate from a coordinate. When this is omitted, it will default to: