Skip to content

Nav Heading Menu

@astryxdesign/core v0.7.1 · NavHeadingMenu

NameTypeDefaultDescription
labelstring—Accessible name of the menu, written to aria-label. Set it when the heading text alone does not say what the menu is.
size'sm' | 'md' | 'lg''md'Width of the menu, which also sets the padding of each item.
minWidthnumber | string—Overrides the minimum width that the size would give. A number is pixels.
focusRequest'first' | 'last' | nullnullMoves focus to the first or the last item once the menu opens. The heading's disclosure passes this in, so a keyboard open lands on an item.
NameDescription
closeFired on Escape. SideNavHeading and TopNavHeading already listen for it and close the popover.
NameDescription
defaultThe menu items.
NameTypeDefaultDescription
labelstring—Primary text of the item. The default slot renders rich content instead.
descriptionstring—Supporting line under the text.
hrefstring—Renders the item as a link when set.
asNavLinkComponent'a'Link root, for example RouterLink. The item then sets both href and to.
iconClassstring—CSS icon class drawn before the text.
isDisabledbooleanfalseDisabled. A click does nothing, and the arrow keys and typeahead skip the item.
NamePayloadDescription
clickMouseEventFired when the item is activated, before the menu closes.
NameDescription
defaultRich content replacing the label prop.
iconIcon content, used ahead of the glyph from iconClass.

The whole menu is one role="menu": arrow keys move between items and wrap at both ends, typing a letter jumps to the next item that starts with it, and Escape closes the popover and returns focus to the heading.