Uh oh!
There was an error while loading. Please reload this page.
feat: implement Toolbar component - #5043
Conversation
MikitasK
left a comment
There was a problem hiding this comment.
nice work! 👍 overall, this looks like a solid foundation for the new Toolbar components
just a few points to address before merge:
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
JKobrynski
left a comment
There was a problem hiding this comment.
I think it's the last one, and it's minor
Uh oh!
There was an error while loading. Please reload this page.
JKobrynski
commented
Aug 24, 2026
LGTM! @satya164 do you want to take a look? |
Motivation
Introduce a new
Toolbarcomponent implementing the Material Design 3 toolbars spec. Reuse theme tokens (shape, color roles, elevation) and follow the same component-tokens pattern as FAB / Checkbox.Spec re-check (M3 toolbars)
Re-checked the M3 toolbars specs:
variants:floating(self-positioned pill,corner.full, elevation level 3) anddocked(full-width bar pinned to the bottom edge,corner.none, no elevation, extends into safe-area insets).floatingsupportshorizontal/verticalorientation;dockedis always horizontal per spec.standard) colors: container/unselected-buttonsurfaceContainer, icon/labelonSurfaceVariant, selected buttonsecondaryContainerwithonSecondaryFixedVariant(light) /onSecondaryContainer(dark) icon.vibrantcolorScheme: container/unselected-buttonprimaryContainer, icon/labelonPrimaryFixedVariant(light) /onPrimaryContainer(dark), selected button falls back tosurfaceContainerwithonSurfaceicon.IconButton/Buttonchildren are auto-recolored to matchcolorSchemeunless they already set their own color (amodeon either opts them out in favor of their own mode-based coloring).Changes
Toolbar/ tokens / utilssrc/components/Toolbar/{Toolbar.tsx,tokens.ts,utils.ts}:variant(floating/docked),orientation(horizontal/vertical, floating-only),colorScheme(standard/vibrant),containerColoroverride,style/contentContainerStyle,testID,aria-label,theme,refToolbarTokens;dockedextends into safe-area insets via margin outsideSurface's box, keeping the 64dp icon band untouchedwithToolbarChildColorsauto-recolors mode-lessIconButton/Buttonchildren percolorScheme, without touching children that already set their own color/modesrc/index.tsxExample / docs / tests
ToolbarExample.tsx) covering both variants, both orientations, both color schemes, over a scrollable listToolbar.test.tsx) covering shape/elevation per variant, color resolution across light/dark themes for both color schemes, and child auto-recoloring behaviorScope note
Per Satyajit Sahoo's recommendation, this implementation is split into a series of PRs for easier review, rather than landing as one large change. This PR is PR 1 of the series:
colorSchemestandard/vibrant. Component, tokens, tests, docs, example.Related issue
Related to #4988
Test plan
yarn typecheck/yarn lint/ Toolbar unit testsVisual verification
Docs screenshots:
docs/public/screenshots/toolbar_*.png.