feat(menu): modernize Menu to Material Design 3 specs - #5073
Open
mikolajadamowicz wants to merge 13 commits into
Open
feat(menu): modernize Menu to Material Design 3 specs#5073mikolajadamowicz wants to merge 13 commits into
mikolajadamowicz wants to merge 13 commits into
Conversation
Menu.Item used fixed 48dp height with two-line supporting text and a content minWidth that collapsed trailingSupportingText to zero width. Use minHeight + padding for supporting rows, intrinsic row sizing for trailing slots, and showcase the vibrant color scheme in the example.
4 tasks
MikitasK
approved these changes
Aug 25, 2026
MikitasK
left a comment
There was a problem hiding this comment.
thanks for addressing all my #5037 comments, nothing else from my side 👌
just make sure to cover all @JKobrynski comments before merging the PR
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.
PR description
Motivation
Modernize
Menu/Menu.Itemto the latest Material Design 3 specs. Reuse theme tokens (shape, typography, motion, color roles) and extract component tokens in the same pattern as Checkbox / FAB / ConnectedButtonGroup.Spec re-check (M3 menus)
Re-checked M3 menus specs and overview:
surfaceContainerLow. Theelevationprop controls shadow only (Paper'selevation.level2maps to different surfaceContainer tones, so it is not used as the menu fill).colorScheme="vibrant"onMenuandMenu.Item.Changes
Tokens / Menu / Menu.Item
Menu/tokens.tswith sizes, shapes, typography and color roles for both schemessurfaceContainerLow; surfacecorner.large; first/last/selected itemcorner.mediumapplied through a layout context (composeMenuChildren+context.tsx) — nocloneElement, nodisplayNamefilteringMenu.ItemgainssupportingText,trailingSupportingText,selected,colorScheme,roundedTop/roundedBottom, matchingsupportingTextStyle/trailingSupportingTextStyle, andsupportingTextMaxFontSizeMultiplier/trailingSupportingTextMaxFontSizeMultiplierlabelLarge; selected items use tertiary roles, withdisabledwinning overselectedvia content opacityMenu/motion.ts: spring open/close driven bytoRawSpring, snapping instead when reduce-motion is oncolorSchemeonMenu:standard|vibrantExample / docs / tests
Test infrastructure
jest/setNodeEnv.jssetsNODE_ENV=testbefore React Native loads, soAnimatedforce-updates host styles andtoHaveStylecan see themjest/testSetup.jsstubsAnimated.springthe same wayAnimated.timingwas already stubbed, so native-driver animations don't fail under JestReview feedback from #5037
All five inline comments from @MikitasK are addressed:
Menu.Itemnow falls back toMenuRootContextforcolorScheme, so items rendered inside a wrapper orFragment— which never receiveMenuItemLayoutContext— no longer drop back tostandardinside a vibrant menusupportingTextandtrailingSupportingTextuse explicit presence flags instead of truthiness, so numeric values such as0render while boolean placeholders stay ignoredtrailingSupportingTextgrow with their content instead of keeping a fixed 48/32dp height, which previously clipped at large accessibility font sizesEach fix has a regression test that fails without it.
Two further accessibility / spec fixes
Found while verifying the above on device:
maxFontSizeMultiplier, the two supporting texts passed nothing, so at accessibility sizes they outgrew the title they belong to and truncated. AddedsupportingTextMaxFontSizeMultiplierandtrailingSupportingTextMaxFontSizeMultiplier, both defaulting to1.5to match the title. Naming follows the existingListItempair.⌘Csat next to the label rather than at the menu edge where M3 puts it. The row now stretches and the trailing text uses an auto left margin. Menu width is unchanged.Related issue
Fixes #4977
Test plan
yarn typecheck/yarn lint/ full unit test suite green (55 suites, 762 tests, 169 snapshots)tsc --noEmitVisual verification