Repository navigation
refactor(bottom-navigation): align with MD3 navigation behavior #5120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -13,6 +13,7 @@ The following props now accept animated styles returned from `useAnimatedStyle`. | |||||||||||||||||||||||||||||||||||||||||||||
| - `Appbar.Action` and `Appbar.BackAction`: `style` | ||||||||||||||||||||||||||||||||||||||||||||||
| - `Badge`: `style` | ||||||||||||||||||||||||||||||||||||||||||||||
| - `Banner`: `style` | ||||||||||||||||||||||||||||||||||||||||||||||
| - `BottomNavigation`: `barStyle`, and `BottomNavigation.Bar`: `style` | ||||||||||||||||||||||||||||||||||||||||||||||
| - `Button`: `style` | ||||||||||||||||||||||||||||||||||||||||||||||
| - `Card`: `style` | ||||||||||||||||||||||||||||||||||||||||||||||
| - `Chip`: `style` | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -109,6 +110,31 @@ Some components now accept explicit `testID` props for their interactable elemen | |||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| ## Components | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| ### BottomNavigation | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| The bar follows the Material Design 3 Expressive navigation bar spec. | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| - Height is 64dp (was 80dp when unlabeled, and the label used a 56dp height constant). | ||||||||||||||||||||||||||||||||||||||||||||||
| - The active indicator is 56×32 with a full corner, and it now stays mounted so the pill can scale and fade with a spatial spring. | ||||||||||||||||||||||||||||||||||||||||||||||
| - Active labels use the `secondary` color and `labelMediumEmphasized`. Horizontal items (medium windows) place the label on the indicator and use `onSecondaryContainer`. | ||||||||||||||||||||||||||||||||||||||||||||||
| - Destinations use visible state layers. The previous `rippleColor: 'transparent'` treatment is gone. | ||||||||||||||||||||||||||||||||||||||||||||||
| - `itemLayout` selects `vertical`, `horizontal`, or `auto` (switches at 600dp). The default is `auto`. | ||||||||||||||||||||||||||||||||||||||||||||||
| - `shifting` no longer translates icons or requires two tabs. It only fades inactive labels in place. | ||||||||||||||||||||||||||||||||||||||||||||||
| - Scene and bar animations use Reanimated. `barStyle` / `BottomNavigation.Bar` `style` accept Reanimated animated styles, not `Animated.Value`. `sceneAnimationEasing` is an `(value: number) => number` function. | ||||||||||||||||||||||||||||||||||||||||||||||
| - Screens still lazy-mount on first visit. Route updates only remount a destination when its `key` changes; inactive screens keep their mounted state. | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| ```diff | ||||||||||||||||||||||||||||||||||||||||||||||
| <BottomNavigation | ||||||||||||||||||||||||||||||||||||||||||||||
| navigationState={{ index, routes }} | ||||||||||||||||||||||||||||||||||||||||||||||
| onIndexChange={setIndex} | ||||||||||||||||||||||||||||||||||||||||||||||
| renderScene={renderScene} | ||||||||||||||||||||||||||||||||||||||||||||||
| - sceneAnimationEasing={Easing.ease} | ||||||||||||||||||||||||||||||||||||||||||||||
| + itemLayout="auto" | ||||||||||||||||||||||||||||||||||||||||||||||
| + sceneAnimationEnabled | ||||||||||||||||||||||||||||||||||||||||||||||
| + sceneAnimationType="opacity" | ||||||||||||||||||||||||||||||||||||||||||||||
| /> | ||||||||||||||||||||||||||||||||||||||||||||||
| ``` | ||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+126
to
+136
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This diff reads as if the easing was removed and three props became required.
Suggested change
(via Claude, verify if it makes sense) |
||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| ### Appbar | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| The `style` props for `Appbar` and `Appbar.Header` no longer accept `Animated.Value` or `Animated.AnimatedInterpolation`. They only accept static styles. | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
autois already the default, so this line does nothing. The same applies todocs/src/data/extendedExamples/BottomNavigationBar.ts(lines 34 and 139) andexample/src/Examples/BottomNavigationBarExample.tsx(line 39). Keeping it in every snippet suggests it is required.(via Claude, verify if it makes sense)