Navigation provides default transition animations, as well as custom transition animations and shared element transition animations.
The system provides multiple default transition types, which can be implemented through the NavDestination.systemTransition API. For details, see Setting Default Transition Animations for the NavDestination Component.
You can disable the default transition animations in either of the following ways:
On a Global Basis
You can call the disableAnimation API provided by NavPathStack to disable or enable all transition animations for the current Navigation component.
pageStack: NavPathStack = new NavPathStack();
aboutToAppear(): void {
this.pageStack.disableAnimation(true);
} On a One-Time Basis
The pushPath, pop, and replacePath APIs provided by NavPathStack accept an optional animated parameter. If you want to disable the transition animation on a one-time basis, set animated to false. The setting does not affect the next transition animation.
Navigation provides two levels of custom transition support: one for the entire Navigation component, and one for individual NavDestination pages.
A custom transition animation for the Navigation component is provided by customNavContentTransition, which can control all pages in Navigation and unify the transition animation effect. The procedure is as follows. For details about the sample code, see Setting an Interactive Transition Animation.
The NavDestination component supports custom transition animations, which are used to control the transition effect of a single page. You can set the customTransition attribute to implement the custom transition effect of a single page. The procedure is as follows. For details about the sample code, see Setting a Custom Transitions for the NavDestination Component.
When both customNavContentTransition and customTransition are used, customNavContentTransition takes precedence.