feat(NavMenu): add XDSNavHeadingMenu container with size and keyboard nav - #1999
Merged
Conversation
… nav Adds XDSNavHeadingMenu as an accessible menu container for nav heading popovers with: - role="menu" + arrow key/Home/End/Escape keyboard navigation - size prop (sm/md/lg) controlling min-width and flowing to items - minWidth override for custom widths Adds XDSNavHeadingMenuItem with size-aware padding from parent context. XDSNavMenuItem is preserved as a deprecated re-export for backward compat — codemod to follow in a separate PR. Heading components updated to provide size in context.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
PR Analysis Report📚 Storybook PreviewView Storybook for this PR 🧪 Sandbox PreviewView Sandbox for this PR No new or modified components detected. Bundle Size Summary
Accessibility AuditStatus: No accessibility violations detected. Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
Headings provide only closeMenu via XDSNavMenuCloseContext. XDSNavHeadingMenu reads that and provides size + closeMenu via XDSNavMenuContext. Clean separation of concerns — headings don't know about menu sizing.
- XDSNavHeadingCloseContext — heading provides closeMenu - XDSNavHeadingMenuContext — menu provides size + closeMenu to items Both scoped to their owner with matching XDSNavHeading* prefix.
cixzhang
added a commit
that referenced
this pull request
Jun 21, 2026
cixzhang
added a commit
that referenced
this pull request
Jun 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
XDSNavHeadingMenuas an accessible menu container for nav heading popovers, andXDSNavHeadingMenuItemwith size-aware padding.Motivation
Ernest requested spacious nav menu items. The heading menus also needed a reasonable min-width. Currently, nav heading
menucontent is bare fragments — the heading itself owns therole="menu"container, keyboard wiring, and context provider. This PR extracts that into a composable container component.What's new
XDSNavHeadingMenu— accessible menu container:role="menu"with arrow key / Home / End / Escape keyboard navigation viauseListFocussizeprop (sm|md|lg) controlling min-width (160/200/240px) and flowing to items via contextminWidthoverride for custom widthsXDSNavHeadingMenuItem— size-aware menu item:sizefrom parentXDSNavHeadingMenucontext for consistent paddingXDSNavMenuItem(icon, label, description, href, onClick, isDisabled)lgsize for spacious layoutsMigration
XDSNavMenuItemis preserved as a deprecated re-export ofXDSNavHeadingMenuItem. Codemod to follow in a separate PR after checking internal impact.Usage
Tests
18 new tests covering:
XDSNavMenuItem===XDSNavHeadingMenuItem)