• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# NavDestination
2
3**NavDestination** is the root container of a destination page and represents the content area of the [Navigation](ts-basic-components-navigation.md) component.
4
5> **NOTE**
6>
7> - This component is supported since API version 9. Updates will be marked with a superscript to indicate their earliest API version.
8>
9> - Since API version 11, this component supports the safe area attribute by default, with the default attribute value being **expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])**. You can override this attribute to change the default behavior. In earlier versions, you need to use the [expandSafeArea](ts-universal-attributes-expand-safe-area.md) attribute to implement the safe area feature.
10>
11> - The **NavDestination** component must be used in conjunction with the **Navigation** component to act as the root node for the navigation destination page. When used alone, it can only function as a standard container component and does not possess any routing-related attributes or capabilities.
12>
13> - If the lifecycle of a page in the middle of the navigation stack changes, the lifecycle of the destination page at the top of the stack before the transition (**onWillShow**, **onShown**, **onHidden**, **onWillDisappear**) and the lifecycle of the destination page after the transition (**onWillShow**, **onShown**, **onHidden**, **onWillDisappear**) are both triggered at the end.
14>
15> - If no main title or subtitle is set for **NavDestination** and there is no back button, the title bar is not displayed.
16
17## Child Components
18
19Built-in components and custom components are allowed, with support for ([if/else](../../../quick-start/arkts-rendering-control-ifelse.md), [ForEach](../../../quick-start/arkts-rendering-control-foreach.md), and [LazyForEach](../../../quick-start/arkts-rendering-control-lazyforeach.md)) rendering control.
20
21Number of child components: multiple.
22
23
24## APIs
25
26NavDestination()
27
28**Atomic service API**: This API can be used in atomic services since API version 11.
29
30**System capability**: SystemCapability.ArkUI.ArkUI.Full
31
32## Attributes
33
34The [universal attributes](ts-component-general-attributes.md) are supported.
35
36Avoid setting layout-related attributes such as the position and size. They may result in display issues on the page.
37
38### title
39
40title(value: string | CustomBuilder | NavDestinationCommonTitle | NavDestinationCustomTitle | Resource, options?: NavigationTitleOptions)
41
42Sets the page title. When the NavigationCustomTitle type is used to set the height, the [titleMode](ts-basic-components-navigation.md#titlemode) attribute does not take effect. When the title string is too long: (1) If no subtitle is set, the string is scaled down, wrapped in two lines, and then clipped with an ellipsis (...); (2) If a subtitle is set, the subtitle is scaled down and then clipped with an ellipsis (...).
43
44**Atomic service API**: This API can be used in atomic services since API version 11.
45
46**System capability**: SystemCapability.ArkUI.ArkUI.Full
47
48**Parameters**
49
50| Name| Type                                                        | Mandatory| Description      |
51| ------ | ------------------------------------------------------------ | ---- | ---------- |
52| value  | string \| [CustomBuilder](ts-types.md#custombuilder8) \| [NavDestinationCommonTitle](#navdestinationcommontitle) \| [NavDestinationCustomTitle](#navdestinationcustomtitle) \| [Resource<sup>14+</sup>](ts-types.md#resource)  | Yes  | Page title.|
53| options<sup>12+</sup> | [NavigationTitleOptions](ts-basic-components-navigation.md#navigationtitleoptions11) | No  | Title bar options.|
54
55### hideTitleBar
56
57hideTitleBar(value: boolean)
58
59Specifies whether to hide the title bar.
60
61**Atomic service API**: This API can be used in atomic services since API version 11.
62
63**System capability**: SystemCapability.ArkUI.ArkUI.Full
64
65**Parameters**
66
67| Name| Type   | Mandatory| Description                                                        |
68| ------ | ------- | ---- | ------------------------------------------------------------ |
69| value  | boolean | Yes  | Whether to hide the title bar.<br>Default value: **false**<br>**true**: Hide the title bar.<br>**false**: Display the title bar.|
70
71### hideTitleBar<sup>13+</sup>
72
73hideTitleBar(hide: boolean, animated: boolean)
74
75Sets whether to hide the title bar and whether to animate the visibility change.
76
77**Atomic service API**: This API can be used in atomic services since API version 13.
78
79**System capability**: SystemCapability.ArkUI.ArkUI.Full
80
81**Parameters**
82
83| Name| Type   | Mandatory| Description                                                        |
84| ------ | ------- | ---- | ------------------------------------------------------------ |
85| hide  | boolean | Yes  | Whether to hide the title bar.<br>Default value: **false**<br>**true**: Hide the title bar.<br>**false**: Show the title bar.|
86| animated  | boolean | Yes  | Whether to animate the visibility change.<br>Default value: **false**<br>**true**: Animate the visibility change.<br>**false**: Do not animate the visibility change.|
87
88### toolbarConfiguration<sup>13+</sup>
89
90toolbarConfiguration(toolbarParam: Array&lt;ToolbarItem&gt; | CustomBuilder, options?: NavigationToolbarOptions)
91
92Sets the content of the toolbar. If this API is not called, the toolbar remains hidden.
93
94**Atomic service API**: This API can be used in atomic services since API version 13.
95
96**System capability**: SystemCapability.ArkUI.ArkUI.Full
97
98**Parameters**
99
100| Name      | Type                                                        | Mandatory| Description                                                        |
101| ------------ | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
102| toolbarParam |  Array&lt;[ToolbarItem](ts-basic-components-navigation.md#toolbaritem10)&gt;  \| [CustomBuilder](ts-types.md#custombuilder8) | Yes  | Content of the toolbar.<br>When configured with Array&lt;[ToolbarItem](ts-basic-components-navigation.md#toolbaritem10)&gt;, the toolbar follows the rules below:<br>- Toolbar items are evenly distributed on the bottom toolbar, with text and icons evenly spaced in each content area.<br>- If any item contains overlong text and there are fewer than five items, the toolbar will: 1. Increase the item width to accommodate the text until the toolbar spans the screen width; 2. Reduce the text size progressively; 3. Wrap the text over two lines; 4. Clip the text with an ellipsis (...).<br>- In portrait mode, the toolbar shows a maximum of five icons, with any additional icons placed under an automatically generated **More** icon. In landscape mode, the behavior of the toolbar is determined by the display mode: (1) If the display mode is [Split](ts-basic-components-navigation.md#navigationmode9), the toolbar follows the same rules as in portrait mode. (2) If the display mode is [Stack](ts-basic-components-navigation.md#navigationmode9), the toolbar must be used together with Array&lt;[NavigationMenuItem](ts-basic-components-navigation.md#navigationmenuitem)&gt; of the **menus** attribute; in this configuration, the bottom toolbar is automatically hidden, and all items on the toolbar are relocated to the menu in the upper right corner of the screen.<br>When configured with [CustomBuilder](ts-types.md#custombuilder8), the toolbar does not follow the above rules, except for evenly distributing items at the bottom of the toolbar.|
103| options      | [NavigationToolbarOptions](ts-basic-components-navigation.md#navigationtoolbaroptions11) | No  | Toolbar options.                                                |
104
105> **NOTE**
106>
107> The following are not allowed: modify the icon size through the **fontSize** attribute of the **SymbolGlyphModifier** object, change the animation effects through the **effectStrategy** attribute, or change the type of animation effects through the **symbolEffect** attribute.
108
109### hideToolBar<sup>13+</sup>
110
111hideToolBar(hide: boolean, animated?: boolean)
112
113Sets whether to hide the toolbar and whether to animate the visibility change.
114
115**Atomic service API**: This API can be used in atomic services since API version 13.
116
117**System capability**: SystemCapability.ArkUI.ArkUI.Full
118
119**Parameters**
120
121| Name| Type   | Mandatory| Description                                                        |
122| ------ | ------- | ---- | ------------------------------------------------------------ |
123| hide  | boolean | Yes  | Whether to hide the toolbar.<br>Default value: **false**<br>**true**: Hide the toolbar.<br>**false**: Show the toolbar.|
124| animated  | boolean | No  | Whether to animate the visibility change.<br>Default value: **false**<br>**true**: Animate the visibility change.<br>**false**: Do not animate the visibility change.|
125
126### mode <sup>11+</sup>
127
128mode(value: NavDestinationMode)
129
130Sets the mode of the **NavDestination** component. Dynamic modification is not supported.
131
132**Atomic service API**: This API can be used in atomic services since API version 12.
133
134**System capability**: SystemCapability.ArkUI.ArkUI.Full
135
136**Parameters**
137
138| Name| Type                                                | Mandatory| Description                                                        |
139| ------ | ---------------------------------------------------- | ---- | ------------------------------------------------------------ |
140| value  | [NavDestinationMode](#navdestinationmode11) | Yes  | Mode of the **NavDestination** component.<br>Default value: **NavDestinationMode.STANDARD**|
141
142### backButtonIcon<sup>11+</sup>
143
144backButtonIcon(value: ResourceStr | PixelMap | SymbolGlyphModifier)
145
146> **NOTE**
147>
148> The following are not allowed: modify the icon size through the **fontSize** attribute of the **SymbolGlyphModifier** object, change the animation effects through the **effectStrategy** attribute, or change the type of animation effects through the **symbolEffect** attribute.
149
150
151Sets the icon of the back button on the title bar.
152
153**Atomic service API**: This API can be used in atomic services since API version 12.
154
155**System capability**: SystemCapability.ArkUI.ArkUI.Full
156
157**Parameters**
158
159| Name| Type                                                        | Mandatory| Description              |
160| ------ | ------------------------------------------------------------ | ---- | ------------------ |
161| value  | [ResourceStr](ts-types.md#resourcestr) \| [PixelMap](../../apis-image-kit/js-apis-image.md#pixelmap7) \| [SymbolGlyphModifier<sup>12+</sup>](ts-universal-attributes-attribute-modifier.md)  | Yes  | Icon of the back button on the title bar.|
162
163### menus<sup>12+</sup>
164
165menus(value: Array&lt;NavigationMenuItem&gt; | CustomBuilder)
166
167> **NOTE**
168>
169> The following are not allowed: modify the icon size through the **fontSize** attribute of the **SymbolGlyphModifier** object, change the animation effects through the **effectStrategy** attribute, or change the type of animation effects through the **symbolEffect** attribute.
170
171
172Sets the menu items in the upper right corner of the page. If this attribute is not set, no menu item is displayed. When the value type is Array<[NavigationMenuItem](ts-basic-components-navigation.md#navigationmenuitem)&gt;, the menu shows a maximum of three icons in portrait mode and a maximum of five icons in landscape mode, with excess icons (if any) placed under the automatically generated **More** icon.
173
174**Atomic service API**: This API can be used in atomic services since API version 12.
175
176**System capability**: SystemCapability.ArkUI.ArkUI.Full
177
178**Parameters**
179
180| Name| Type                                                        | Mandatory| Description              |
181| ------ | ------------------------------------------------------------ | ---- | ------------------ |
182| value  | Array<[NavigationMenuItem](ts-basic-components-navigation.md#navigationmenuitem)&gt; \| [CustomBuilder](ts-types.md#custombuilder8) | Yes  | Menu items in the upper right corner of the page.|
183
184### ignoreLayoutSafeArea<sup>12+</sup>
185
186ignoreLayoutSafeArea(types?: Array&lt;LayoutSafeAreaType&gt;, edges?: Array&lt;LayoutSafeAreaEdge&gt;)
187
188Ignores the layout safe area by allowing the component to extend into the non-safe areas of the screen.
189
190**Atomic service API**: This API can be used in atomic services since API version 12.
191
192**System capability**: SystemCapability.ArkUI.ArkUI.Full
193
194**Parameters**
195
196| Name| Type                                              | Mandatory| Description                                                        |
197| ------ | -------------------------------------------------- | ---- | ------------------------------------------------------------ |
198| types  | Array <[LayoutSafeAreaType](ts-types.md#layoutsafeareatype12)> | No  | Types of non-safe areas to extend into.<br>Default value:<br>[LayoutSafeAreaType.SYSTEM] |
199| edges  | Array <[LayoutSafeAreaEdge](ts-types.md#layoutsafeareaedge12)> | No  | Edges for expanding the safe area.<br> Default value:<br>[LayoutSafeAreaEdge.TOP, LayoutSafeAreaEdge.BOTTOM]|
200
201>  **NOTE**
202>
203>  After **LayoutSafeArea** is set:
204>  When **LayoutSafeAreaType.SYSTEM** is set, the component can extend into the non-safe area if its boundaries overlap with it. For example, if the device's status bar is 100 high, the component must have an absolute vertical offset between 0 and 100 to extend into the non-safe area.
205>
206>  If the component extends into the non-safe area, events triggered within that area (such as click events) might be intercepted by the system. This allows the system to prioritize responses to system components such as the status bar.
207
208### systemBarStyle<sup>12+</sup>
209
210systemBarStyle(style: Optional&lt;SystemBarStyle&gt;)
211
212Sets the style of the system status bar when this **NavDestination** page is displayed in the **Navigation** component.
213
214**Atomic service API**: This API can be used in atomic services since API version 12.
215
216**System capability**: SystemCapability.ArkUI.ArkUI.Full
217
218**Parameters**
219
220| Name| Type        | Mandatory| Description              |
221| ------ | -------------- | ---- | ------------------ |
222| style  | [Optional](ts-universal-attributes-custom-property.md#optional12)&lt;[SystemBarStyle](../js-apis-window.md#systembarstyle12)&gt; | Yes  | Style of the system status bar.|
223
224> **NOTE**
225>
226> 1. The setting takes effect only when the **NavDestination** component is used in conjunction with the **Navigation** component.
227> 2. For other usage restrictions, see the description of [systemBarStyle](ts-basic-components-navigation.md#systembarstyle12) for the **Navigation** component.
228
229### systemTransition<sup>14+</sup>
230systemTransition(type: NavigationSystemTransitionType)
231
232Sets the system transition animation of the **NavDestination** component. System transition animations for the title bar and content area can be configured separately.
233
234**Atomic service API**: This API can be used in atomic services since API version 14.
235
236**System capability**: SystemCapability.ArkUI.ArkUI.Full
237
238**Parameters**
239
240| Name| Type                                                | Mandatory| Description                                                        |
241| ------ | ---------------------------------------------------- | ---- | ------------------------------------------------------------ |
242| type  | [NavigationSystemTransitionType](#navigationsystemtransitiontype14) | Yes  | Type of the system transition animation.<br>Default value: **NavigationSystemTransitionType.DEFAULT**|
243
244### recoverable<sup>14+</sup>
245
246recoverable(recoverable: Optional&lt;boolean&gt;)
247
248Sets whether the **NavDestination** component is recoverable. If set to recoverable, when the application process exits unexpectedly and restarts, the **NavDestination** component will be automatically recreated. To use this feature, ensure that the **recoverable** attribute is set for the **Navigation** component associated with the **NavDestination** component.
249
250**System capability**: SystemCapability.ArkUI.ArkUI.Full
251
252**Parameters**
253
254| Name| Type        | Mandatory| Description              |
255| ------ | -------------- | ---- | ------------------ |
256| recoverable  | [Optional](ts-universal-attributes-custom-property.md#optional12)&lt;boolean&gt; | Yes  | Whether the **NavDestination** component is recoverable. By default, it is not recoverable.<br>Default value: **false**<br>**true**: The **NavDestination** component is recoverable.<br>**false**: The **NavDestination** component is not recoverable.|
257
258>  **NOTE**
259>
260> This API must be used together with the [recoverable](./ts-basic-components-navigation.md#recoverable14) API of **Navigation**.
261
262### bindToScrollable<sup>14+</sup>
263bindToScrollable(scrollers: Array&lt;Scroller&gt;)
264
265Binds the **NavDestination** component with a scrollable container, which can be a [List](./ts-container-list.md), [Scroll](./ts-container-scroll.md), [Grid](./ts-container-grid.md), or [WaterFlow](./ts-container-waterflow.md) component. This way, scrolling in the scrollable container triggers the display and hide animations of the title bar and toolbar of all **NavDestination** components that are bound to it �C scrolling up triggers the hide animation, and scrolling down triggers the show animation. A single **NavDestination** component can be bound to multiple scrollable containers, and a single scrollable container can be bound to multiple **NavDestination** components. For details, see [Example 1](#example-1-linking-the-title-bar-and-toolbar-with-scrollable-components).
266
267> **NOTE**
268>
269> - The connection between the scrolling actions and the animations for showing or hiding the title bar and toolbar of the **NavDestination** component takes effect only when the title bar or toolbar is visible.
270> - If a **NavDestination** component is bound to multiple scrollable containers, scrolling in any of these containers triggers the display or hiding animations of the title bar and toolbar. Specifically, when any scrollable container reaches either the bottom or the top, the display animation for the title bar and toolbar is triggered without delay. As such, to ensure the optimal user experience, avoid triggering scroll events of multiple scrollable containers simultaneously.
271
272**Atomic service API**: This API can be used in atomic services since API version 14.
273
274**System capability**: SystemCapability.ArkUI.ArkUI.Full
275
276**Parameters**
277
278| Name| Type                                                | Mandatory| Description                                                        |
279| ------ | ---------------------------------------------------- | ---- | ------------------------------------------------------------ |
280| scrollers | Array<[Scroller](./ts-container-scroll.md#scroller)> | Yes  | Controller of the target scrollable container.|
281
282### bindToNestedScrollable<sup>14+</sup>
283bindToNestedScrollable(scrollInfos: Array&lt;NestedScrollInfo&gt;)
284
285Binds the **NavDestination** component with a nested scrollable container, which can be a [List](./ts-container-list.md), [Scroll](./ts-container-scroll.md), [Grid](./ts-container-grid.md), or [WaterFlow](./ts-container-waterflow.md) component. This way, scrolling in the scrollable container triggers the display and hide animations of the title bar and toolbar of all **NavDestination** components that are bound to it �C scrolling up triggers the hide animation, and scrolling down triggers the show animation. A single **NavDestination** component can be bound to multiple nested scrollable containers, and a single nested scrollable container can be bound to multiple **NavDestination** components. For details, see [Example 1](#example-1-linking-the-title-bar-and-toolbar-with-scrollable-components).
286
287> **NOTE**
288>
289> - The connection between the scrolling actions and the animations for showing or hiding the title bar and toolbar of the **NavDestination** component takes effect only when the title bar or toolbar is visible.
290> - If a **NavDestination** component is bound to multiple scrollable containers, scrolling in any of these containers triggers the display or hiding animations of the title bar and toolbar. Specifically, when any scrollable container reaches either the bottom or the top, the display animation for the title bar and toolbar is triggered without delay. As such, to ensure the optimal user experience, avoid triggering scroll events of multiple scrollable containers simultaneously.
291
292**Atomic service API**: This API can be used in atomic services since API version 14.
293
294**System capability**: SystemCapability.ArkUI.ArkUI.Full
295
296**Parameters**
297
298| Name| Type                                                | Mandatory| Description                                                        |
299| ------ | ---------------------------------------------------- | ---- | ------------------------------------------------------------ |
300| scrollInfos | Array<[NestedScrollInfo](#nestedscrollinfo14)> | Yes  | Controller of the target nested scrollable containers.|
301
302### hideBackButton<sup>15+</sup>
303
304hideBackButton(hide: Optional&lt;boolean&gt;)
305
306Sets whether to hide the back button in the title bar.
307
308**Atomic service API**: This API can be used in atomic services since API version 15.
309
310**System capability**: SystemCapability.ArkUI.ArkUI.Full
311
312**Parameters**
313
314| Name| Type   | Mandatory| Description                                                        |
315| ------ | ------- | ---- | ------------------------------------------------------------ |
316| hide  | [Optional](ts-universal-attributes-custom-property.md#optional12)&lt;boolean&gt; | Yes  | Whether to hide the back button in the title bar.<br>Default value: **false**<br>**true**: Hide the back button.<br>**false**: Show the back button.|
317
318### customTransition<sup>15+</sup>
319
320customTransition(delegate: NavDestinationTransitionDelegate)
321
322Sets a custom transition animation for the **NavDestination** component.
323
324> **NOTE**
325>
326> If both this attribute and [systemTransition](#systemtransition14) are set, whichever is set later takes effect.
327
328**Atomic service API**: This API can be used in atomic services since API version 15.
329
330**System capability**: SystemCapability.ArkUI.ArkUI.Full
331
332**Parameters**
333
334| Name| Type   | Mandatory| Description                                                        |
335| ------ | ------- | ---- | ------------------------------------------------------------ |
336| delegate  | [NavDestinationTransitionDelegate](#navdestinationtransitiondelegate15) | Yes  | Delegate function for custom animations of the **NavDestination** component.|
337
338## NavDestinationMode<sup>11+</sup>
339
340**Atomic service API**: This API can be used in atomic services since API version 12.
341
342**System capability**: SystemCapability.ArkUI.ArkUI.Full
343
344| Name  | Value| Description                                    |
345| ---- | --- | ---------------------------------------- |
346| STANDARD | 0 | Standard mode.                      |
347| DIALOG | 1 | Dialog mode, where the navigation destination is transparent by default, and adding or removing the navigation destination from the navigation stack does not affect the lifecycle of the lower-layer navigation destinations.<br>System transition animations are supported since API version 13. |
348
349## NavigationSystemTransitionType<sup>14+</sup>
350
351**System capability**: SystemCapability.ArkUI.ArkUI.Full
352
353| Name  | Value  | Description|
354| ----  | ---   | ----- |
355| DEFAULT | 0 | Default system transition animation.<br>**Atomic service API**: This API can be used in atomic services since API version 14.|
356| NONE| 1 | No system transition animation.<br>**Atomic service API**: This API can be used in atomic services since API version 14.|
357| TITLE | 2 | System transition animation of the title bar.<br>**Atomic service API**: This API can be used in atomic services since API version 14.|
358| CONTENT | 3 | System transition animation of the content area.<br>**Atomic service API**: This API can be used in atomic services since API version 14.|
359| FADE<sup>15+</sup> | 4 | Fade-type system transition animation.<br>**Atomic service API**: This API can be used in atomic services since API version 15.|
360| EXPLODE<sup>15+</sup> | 5 | Center-scale type system transition animation.<br>**Atomic service API**: This API can be used in atomic services since API version 15.|
361| SLIDE_RIGHT<sup>15+</sup> | 6 | Right-slide type system transition animation.<br>**Atomic service API**: This API can be used in atomic services since API version 15.|
362| SLIDE_BOTTOM<sup>15+</sup> | 7 | Bottom-slide type system transition animation.<br>**Atomic service API**: This API can be used in atomic services since API version 15.|
363
364**NOTE**
365>
366> System transition animations for the title bar and content area can be configured separately.
367>
368> The system transition animation of the title bar is only available for the push and pop animations of navigation destination pages in STANDARD mode, with the following constraints:
369> 1. When **NavigationSystemTransitionType** is set to **TITLE**, only the system transition animation of the title bar is displayed.
370> 2. When **NavigationSystemTransitionType** is set to **CONTENT**, only the system transition animation of the content area is displayed.
371>
372> When **NONE** or **TITLE** is set, no system transition animation is displayed. When **CONTENT** or **DEFAULT** is set, the system transition animation is displayed by default.
373
374## Events
375
376In addition to the [universal events](ts-component-general-events.md), the following events are supported.
377
378### onShown<sup>10+</sup>
379
380onShown(callback: () =&gt; void)
381
382Called when the navigation destination page is displayed.
383
384**Atomic service API**: This API can be used in atomic services since API version 11.
385
386**System capability**: SystemCapability.ArkUI.ArkUI.Full
387
388### onHidden<sup>10+</sup>
389
390onHidden(callback: () =&gt; void)
391
392Called when the navigation destination page is hidden.
393
394**Atomic service API**: This API can be used in atomic services since API version 11.
395
396**System capability**: SystemCapability.ArkUI.ArkUI.Full
397
398### onWillAppear<sup>12+</sup>
399
400onWillAppear(callback: Callback\<void>)
401
402Called when the navigation destination is about to be mounted. You can change the navigation stack in this callback function, and the change takes effect in the current frame.
403
404**Atomic service API**: This API can be used in atomic services since API version 12.
405
406**System capability**: SystemCapability.ArkUI.ArkUI.Full
407
408### onWillShow<sup>12+</sup>
409
410onWillShow(callback: Callback\<void>)
411
412Called when the navigation destination is about to be displayed.
413
414**Atomic service API**: This API can be used in atomic services since API version 12.
415
416**System capability**: SystemCapability.ArkUI.ArkUI.Full
417
418### onWillHide<sup>12+</sup>
419
420onWillHide(callback: Callback\<void>)
421
422Called when the navigation destination is about to be hidden.
423
424**Atomic service API**: This API can be used in atomic services since API version 12.
425
426**System capability**: SystemCapability.ArkUI.ArkUI.Full
427
428### onWillDisappear<sup>12+</sup>
429
430onWillDisappear(callback: Callback\<void>)
431
432Called when the navigation destination is about to be unmounted (or when the transition animation, if any, is about to start).
433
434**Atomic service API**: This API can be used in atomic services since API version 12.
435
436**System capability**: SystemCapability.ArkUI.ArkUI.Full
437
438### onBackPressed<sup>10+</sup>
439
440onBackPressed(callback: () =&gt; boolean)
441
442This callback takes effect when there is one or more entries in the navigation stack bound to the **Navigation** component. Called when the back button is pressed.
443
444The value **true** means that the back button logic is overridden, and **false** means that the previous page is displayed.
445
446**Atomic service API**: This API can be used in atomic services since API version 11.
447
448**System capability**: SystemCapability.ArkUI.ArkUI.Full
449
450### onReady<sup>11+</sup>
451
452onReady(callback: [Callback](../../apis-basic-services-kit/js-apis-base.md#callback)<[NavDestinationContext](#navdestinationcontext11)>)
453
454Called when the **NavDestination** component is about to build a child component.
455
456**Atomic service API**: This API can be used in atomic services since API version 11.
457
458**System capability**: SystemCapability.ArkUI.ArkUI.Full
459
460### onResult<sup>15+</sup>
461
462onResult(callback: Optional\<Callback\<ESObject\>\>)
463
464Triggered when the **NavDestination** component returns.
465
466**Atomic service API**: This API can be used in atomic services since API version 15.
467
468**System capability**: SystemCapability.ArkUI.ArkUI.Full
469
470**Parameters**
471| Name| Type| Mandatory| Description|
472| ------ | ------ | ---- | ---------------- |
473|callback | [Optional](./ts-universal-attributes-custom-property.md)\<[Callback](../../apis-basic-services-kit/js-apis-base.md#callback)\<ESObject\>\>| Yes| Callback for page returning, with the parameter being the **result** parameter passed to the **pop** API. If this parameter is not passed, the input is **undefined**.|
474
475### onActive<sup>18+</sup>
476
477onActive(callback: Optional\<Callback\<NavDestinationActiveReason\>\>)
478
479Triggered when the **NavDestination** component becomes active (on top of the stack and operable, with no special components blocking it).
480
481**Atomic service API**: This API can be used in atomic services since API version 18.
482
483**System capability**: SystemCapability.ArkUI.ArkUI.Full
484
485**Parameters**
486| Name| Type| Mandatory| Description|
487| ------ | ------ | ---- | ---------------- |
488|callback | [Optional](./ts-universal-attributes-custom-property.md#optional12)\<[Callback](../../apis-basic-services-kit/js-apis-base.md#callback)\<[NavDestinationActiveReason](#navdestinationactivereason18)\>\>| Yes| Reason why the **NavDestination** component switches from inactive to active.|
489
490### onInactive<sup>18+</sup>
491
492onInactive(callback:  Optional\<Callback\<NavDestinationActiveReason\>\>)
493
494Triggered when **NavDestination** component becomes inactive (not on top of the stack and inoperable, or on top but blocked by special components).
495
496**Atomic service API**: This API can be used in atomic services since API version 18.
497
498**System capability**: SystemCapability.ArkUI.ArkUI.Full
499
500**Parameters**
501| Name| Type| Mandatory| Description|
502| ------ | ------ | ---- | ---------------- |
503|callback | [Optional](./ts-universal-attributes-custom-property.md#optional12)\<[Callback](../../apis-basic-services-kit/js-apis-base.md#callback)\<[NavDestinationActiveReason](#navdestinationactivereason18)\>\>| Yes| Reason why the **NavDestination** component switches from active to inactive.|
504
505## NavDestinationCommonTitle
506
507**Atomic service API**: This API can be used in atomic services since API version 11.
508
509**System capability**: SystemCapability.ArkUI.ArkUI.Full
510
511| Name  | Type    | Mandatory  | Description    |
512| ---- | ------ | ---- | ------ |
513| main | string \| [Resource<sup>14+<sup>](ts-types.md#resource) | Yes   | Main title.|
514| sub  | string \| [Resource<sup>14+<sup>](ts-types.md#resource) | Yes   | Subtitle.|
515
516## NavDestinationCustomTitle
517
518**Atomic service API**: This API can be used in atomic services since API version 11.
519
520**System capability**: SystemCapability.ArkUI.ArkUI.Full
521
522| Name     | Type                                      | Mandatory  | Description      |
523| ------- | ---------------------------------------- | ---- | -------- |
524| builder | [CustomBuilder](ts-types.md#custombuilder8) | Yes   | Content of the title bar.|
525| height  | [TitleHeight](ts-appendix-enums.md#titleheight9) \| [Length](ts-types.md#length) | Yes   | Height of the title bar.<br>Value range: [0, +∞)|
526
527## NavDestinationContext<sup>11+</sup>
528
529**System capability**: SystemCapability.ArkUI.ArkUI.Full
530
531| Name  | Type    | Mandatory  |  Description    |
532| ---- | ------ | ----- | ------ |
533| pathInfo | [NavPathInfo](ts-basic-components-navigation.md#navpathinfo10) | Yes| Path information of the navigation destination page.<br>**Atomic service API**: This API can be used in atomic services since API version 11.|
534| pathStack  | [NavPathStack](ts-basic-components-navigation.md#navpathstack10) | Yes| Page stack where the current navigation destination page is located.<br>**Atomic service API**: This API can be used in atomic services since API version 11.|
535| navDestinationId<sup>12+</sup> | string | No| Unique ID of the current navigation destination page, which is automatically generated by the system and is irrelevant to the universal attribute **id** of the component.<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
536
537### getConfigInRouteMap<sup>12+</sup>
538
539getConfigInRouteMap(): RouteMapConfig |undefined
540
541**Atomic service API**: This API can be used in atomic services since API version 12.
542
543**System capability**: SystemCapability.ArkUI.ArkUI.Full
544
545**Return value**
546
547| Type| Description|
548| --- | --- |
549| [RouteMapConfig](#routemapconfig12) | Route map configuration of the current page.|
550| undefined | **undefined**, returned when the page is not configured through the route table.|
551
552## RouteMapConfig<sup>12+</sup>
553
554**Atomic service API**: This API can be used in atomic services since API version 12.
555
556**System capability**: SystemCapability.ArkUI.ArkUI.Full
557
558| Name  | Type  |Mandatory| Description|
559| ----  | ---   | ---- |----- |
560| name  | string | Yes| Page name.|
561| pageSourceFile| string | Yes| Path of the page in the current package.|
562| data | Object | Yes| Custom data of the page.|
563
564## NestedScrollInfo<sup>14+</sup>
565
566Provides the information about the nested scrollable containers.
567
568**Atomic service API**: This API can be used in atomic services since API version 14.
569
570**System capability**: SystemCapability.ArkUI.ArkUI.Full
571
572| Name  | Type  |Mandatory| Description|
573| ----  | ---   | ---- |----- |
574| parent | [Scroller](./ts-container-scroll.md#scroller) | Yes| Controller of the target scrollable container.|
575| child | [Scroller](./ts-container-scroll.md#scroller) | Yes| Controller of the scrollable container nested within the target scrollable container. This scrollable container is a child component of the target scrollable container.|
576
577### NavDestinationActiveReason<sup>18+</sup>
578
579Enumerates the reasons why the activation state of the **NavDestination** component changes.
580
581**Atomic service API**: This API can be used in atomic services since API version 18.
582
583**System capability**: SystemCapability.ArkUI.ArkUI.Full
584
585| Name  | Value| Description                                    |
586| ---- | -- | ---------------------------------------- |
587| TRANSITION | 0   | The activation state changes through page navigation.                      |
588| CONTENT_COVER | 1   | The activation state changes due to the opening or closing of a modal page. |
589| SHEET | 2   | The activation state changes due to the opening or closing of a sheet.|
590| DIALOG | 3   | The activation state changes due to the opening or closing of a custom dialog box.|
591| OVERLAY | 4   | The activation state changes due to the opening or closing of an overlay using **OverlayManager**.|
592| APP_STATE | 5   | The activation state changes due to switching between foreground and background states of the application.|
593
594## NavDestinationTransition<sup>15+</sup>
595
596Defines a custom transition animation for the **NavDestination** component.
597
598**Atomic service API**: This API can be used in atomic services since API version 15.
599
600**System capability**: SystemCapability.ArkUI.ArkUI.Full
601
602| Name  | Type  |Mandatory| Description|
603| ----  | ---   | ---- |----- |
604| onTransitionEnd | Callback\<void> | No| Callback triggered when the transition animation ends.|
605| duration | number | No| Duration of the transition animation.<br>Default value: **1000** (in milliseconds)|
606| curve | [Curve](ts-appendix-enums.md#curve) | No| Curve type of the animation.<br>Default value: Curve.EaseInOut](ts-appendix-enums.md#curve)|
607| delay | number | No| Delay of the transition animation. <br>Default value: **0** (in milliseconds)|
608| event | Callback\<void> | Yes| Closure function specifying the transition animation. The system generates the corresponding transition animation based on the modifications to the component's UI state within the closure. For details, see **event** in [animateTo](../js-apis-arkui-UIContext.md#animateto).|
609
610## NavDestinationTransitionDelegate<sup>15+</sup>
611
612type NavDestinationTransitionDelegate = (operation: NavigationOperation, isEnter: boolean) => Array\<NavDestinationTransition> | undefined
613
614Defines the delegate function for custom transition animations of the **NavDestination** component.
615
616**Atomic service API**: This API can be used in atomic services since API version 15.
617
618**System capability**: SystemCapability.ArkUI.ArkUI.Full
619
620**Parameters**
621
622| Name | Type    | Mandatory| Description                   |
623|------|--------|----|-----------------------|
624| operation | [NavigationOperation](ts-basic-components-navigation.md#navigationoperation11) | Yes | Type of navigation operation for the current page transition.|
625| isEnter | boolean | Yes | Whether the current page is an entry page.<br>**true**: The current page is an entry page.<br>**false**: The current page is not an entry page.|
626
627**Return value**
628
629| Type     | Description       |
630|---------|-----------|
631| Array<[NavDestinationTransition](#navdestinationtransition15)> \| undefined | Array of custom animations for the **NavDestination** page. If **undefined** is returned, the system default animation is used.|
632
633## Example
634
635### Example 1: Linking the Title Bar and Toolbar with Scrollable Components
636
637This example shows how to bind a **NavDestination** component to scrollable containers so that scrolling in the scrollable containers triggers the animations for showing or hiding the title bar and toolbar of the **NavDestination** component.
638
639```ts
640import { SymbolGlyphModifier } from '@kit.ArkUI';
641
642@Component
643struct MyPageOne {
644  private listScroller: Scroller = new Scroller();
645  private scrollScroller: Scroller = new Scroller();
646  private arr: number[] = [];
647
648  aboutToAppear(): void {
649    for (let i = 0; i < 30; i++) {
650      this.arr.push(i);
651    }
652  }
653
654  build() {
655    NavDestination() {
656      Scroll(this.scrollScroller) {
657        Column() {
658          List({ space: 0, initialIndex: 0, scroller: this.listScroller }) {
659            ForEach(this.arr, (item: number, index: number) => {
660              ListItem() {
661                Text('' + item)
662                  .height(100)
663                  .fontSize(16)
664                  .textAlign(TextAlign.Center)
665                  .width('90%')
666                  .margin({ left: '5%' })
667                  .borderRadius(10)
668                  .backgroundColor(Color.Gray)
669              }
670            }, (item: string) => item);
671          }.width('100%').height('80%').scrollBar(BarState.Off)
672          .nestedScroll({ scrollForward: NestedScrollMode.SELF_FIRST, scrollBackward: NestedScrollMode.SELF_FIRST })
673
674          ForEach(this.arr, (item: number, index: number) => {
675            ListItem() {
676              Text('' + item)
677                .height(100)
678                .fontSize(16)
679                .textAlign(TextAlign.Center)
680                .width('90%')
681                .margin({ top: '5%' })
682                .borderRadius(10)
683                .backgroundColor(Color.Pink)
684            }
685          }, (item: string) => item);
686        }
687      }
688      .width('100%')
689      .scrollBar(BarState.Off)
690      .scrollable(ScrollDirection.Vertical)
691      .edgeEffect(EdgeEffect.Spring)
692    }
693    .title('PageOne', { backgroundColor: Color.Yellow, barStyle: BarStyle.STACK })
694    .toolbarConfiguration([
695      {
696        value: 'item1',
697        symbolIcon: new SymbolGlyphModifier($r('sys.symbol.phone_badge_star'))
698      }
699    ], { backgroundColor: Color.Orange, barStyle: BarStyle.STACK })
700    // Bind the NavDestination component to nested scrollable containers.
701    .bindToNestedScrollable([{ parent: this.scrollScroller, child: this.listScroller }])
702  }
703}
704
705@Component
706struct MyPageTwo {
707  private listScroller: Scroller = new Scroller();
708  private arr: number[] = [];
709
710  aboutToAppear(): void {
711    for (let i = 0; i < 30; i++) {
712      this.arr.push(i);
713    }
714  }
715
716  build() {
717    NavDestination() {
718      List({ scroller: this.listScroller }) {
719        ForEach(this.arr, (item: number, index: number) => {
720          ListItem() {
721            Text('' + item)
722              .height(100)
723              .fontSize(16)
724              .textAlign(TextAlign.Center)
725              .width('90%')
726              .margin({ left: '5%' })
727              .borderRadius(10)
728              .backgroundColor(Color.Gray)
729          }
730        }, (item: string) => item);
731      }.width('100%')
732    }
733    .title('PageTwo', { backgroundColor: Color.Yellow, barStyle: BarStyle.STACK })
734    .toolbarConfiguration([
735      {
736        value: 'item1',
737        symbolIcon: new SymbolGlyphModifier($r('sys.symbol.phone_badge_star'))
738      }
739    ], { backgroundColor: Color.Orange, barStyle: BarStyle.STACK })
740    // Bind the NavDestination component to a scrollable container.
741    .bindToScrollable([this.listScroller])
742  }
743}
744
745@Entry
746@Component
747struct Index {
748  private stack: NavPathStack = new NavPathStack();
749
750  @Builder
751  MyPageMap(name: string) {
752    if (name === 'myPageOne') {
753      MyPageOne()
754    } else {
755      MyPageTwo()
756    }
757  }
758
759  build() {
760    Navigation(this.stack) {
761      Column() {
762        Button('push PageOne').onClick(() => {
763          this.stack.pushPath({ name: 'myPageOne' })
764        })
765        Button('push PageTwo').onClick(() => {
766          this.stack.pushPath({ name: 'myPageTwo' })
767        })
768      }.height('40%').justifyContent(FlexAlign.SpaceAround)
769    }.width('100%')
770    .height('100%')
771    .title({ main: 'MainTitle', sub: 'subTitle' })
772    .navDestination(this.MyPageMap)
773  }
774}
775```
776![navdestination_bind_scrollable](figures/navdestination_bind_scrollable.gif)
777
778### Example 2: Setting a Custom Transitions for the NavDestination Component
779
780The following example demonstrates how to set a custom transition animation for the **NavDestination** component using [customTransition](#customtransition15).
781
782```ts
783@Entry
784@Component
785struct NavDestinationCustomTransition {
786  stack: NavPathStack = new NavPathStack()
787
788  @Builder
789  pageMap(name: string) {
790    if (name) {
791      NavDest()
792    }
793  }
794
795  aboutToAppear(): void {
796    this.stack.pushPath({name: 'dest0'})
797  }
798
799  build() {
800    Navigation(this.stack) {
801      // empty
802    }
803    .navDestination(this.pageMap)
804    .hideNavBar(true)
805    .title('Main Page')
806    .titleMode(NavigationTitleMode.Mini)
807  }
808}
809
810declare type voidFunc = () => void;
811
812@Component
813struct NavDest {
814  @State name: string = 'NA'
815  @State destWidth: string = '100%'
816  stack: NavPathStack = new NavPathStack()
817  @State y: string = '0';
818
819  build() {
820    NavDestination() {
821      Column() {
822        Button('push next page', { stateEffect: true, type: ButtonType.Capsule })
823          .width('80%')
824          .height(40)
825          .margin(20)
826          .onClick(() => {
827            this.stack.pushPath({ name: this.name == 'PageOne' ? "PageTwo" : "PageOne" })
828          })
829      }
830      .size({ width: '100%', height: '100%' })
831    }
832    .title(this.name)
833    .translate({ y: this.y })
834    .onReady((context) => {
835      this.name = context.pathInfo.name;
836      this.stack = context.pathStack;
837    })
838    .backgroundColor(this.name == 'PageOne' ? '#F1F3F5' : '#ff11dee5')
839    .customTransition(
840      (op: NavigationOperation, isEnter: boolean)
841        : Array<NavDestinationTransition> | undefined => {
842        console.log('[NavDestinationTransition]', 'reached delegate in frontend, op: ' + op + ', isEnter: ' + isEnter);
843
844        let transitionOneEvent: voidFunc = () => { console.log('[NavDestinationTransition]', 'reached transitionOne, empty now!'); }
845        let transitionOneFinishEvent: voidFunc = () => { console.log('[NavDestinationTransition]', 'reached transitionOneFinish, empty now!'); }
846        let transitionOneDuration: number = 500;
847        if (op === NavigationOperation.PUSH) {
848          if (isEnter) {
849            // ENTER_PUSH
850            this.y = '100%';
851            transitionOneEvent = () => {
852              console.log('[NavDestinationTransition]', 'transitionOne, push & isEnter');
853              this.y = '0';
854            }
855          } else {
856            // EXIT_PUSH
857            this.y = '0';
858            transitionOneEvent = () => {
859              console.log('[NavDestinationTransition]', 'transitionOne, push & !isEnter');
860              this.y = '0';
861            }
862            transitionOneDuration = 450
863          }
864        } else if (op === NavigationOperation.POP) {
865          if (isEnter) {
866            // ENTER_POP
867            this.y = '0';
868            transitionOneEvent = () => {
869              console.log('[NavDestinationTransition]', 'transitionOne, pop & isEnter');
870              this.y = '0';
871            }
872          } else {
873            // EXIT_POP
874            this.y = '0';
875            transitionOneEvent = () => {
876              console.log('[NavDestinationTransition]', 'transitionOne, pop & !isEnter');
877              this.y = '100%';
878            }
879          }
880        } else {
881          console.log('[NavDestinationTransition]', '----- NOT-IMPL BRANCH of NAV-DESTINATION CUSTOM TRANSITION -----');
882        }
883
884        let transitionOne: NavDestinationTransition = {
885          duration: transitionOneDuration,
886          delay: 0,
887          curve: Curve.Friction,
888          event: transitionOneEvent,
889          onTransitionEnd: transitionOneFinishEvent
890        };
891
892        let transitionTwoEvent: voidFunc = () => { console.log('[NavDestinationTransition]', 'reached transitionTwo, empty now!'); }
893        let transitionTwo: NavDestinationTransition = {
894          duration: 1000,
895          delay: 0,
896          curve: Curve.EaseInOut,
897          event: transitionTwoEvent,
898          onTransitionEnd: () => { console.log('[NavDestinationTransition]', 'reached Two\'s finish'); }
899        };
900
901        return [
902          transitionOne,
903          transitionTwo,
904        ];
905      })
906  }
907}
908```
909![navdestination_custom_transition](figures/navdestination_custom_transition.gif)
910
911### Example 3: Setting System Transition Animations for the NavDestination Component
912
913The following example demonstrates how to set system transition animations using [systemTransition](#systemtransition14) with **Fade**, **Explode**, **SlideBottom**, and **SlideRight** effects.
914
915```ts
916@Entry
917@Component
918struct NavDestinationSystemTransition {
919  @Provide stack: NavPathStack = new NavPathStack()
920  @Provide homePageTransitionType: NavigationSystemTransitionType = NavigationSystemTransitionType.DEFAULT;
921
922  @Builder
923  pageMap(name: string) {
924    if (name === 'Fade') {
925      Fade()
926    } else if (name === 'Explode') {
927      Explode()
928    } else if (name === 'SlideRight') {
929      SlideRight()
930    } else if (name === 'SlideBottom') {
931      SlideBottom()
932    } else {
933      Dest()
934    }
935  }
936
937  aboutToAppear(): void {
938    this.stack.pushPath({name: 'Dest'})
939  }
940
941  build() {
942    Navigation(this.stack) {
943      // empty
944    }
945    .navDestination(this.pageMap)
946    .hideNavBar(true)
947  }
948}
949
950@Component
951struct Dest {
952  @Consume stack: NavPathStack;
953  @Consume homePageTransitionType: NavigationSystemTransitionType;
954  @State name: string = 'NA';
955
956  build() {
957    NavDestination() {
958      HomeBody()
959    }
960    .title('Navigation System Animation')
961    .onReady((context) => {
962      this.name = context.pathInfo.name
963    })
964    .systemTransition(this.homePageTransitionType)
965  }
966}
967
968@Component
969struct Fade {
970  @Consume stack: NavPathStack;
971  @State name: string = 'NA';
972
973  build() {
974    NavDestination() {
975      DestBody({
976        name: this.name
977      })
978    }
979    .title(this.name)
980    .onReady((context) => {
981      this.name = context.pathInfo.name
982    })
983    .systemTransition(NavigationSystemTransitionType.FADE)
984  }
985}
986
987@Component
988struct Explode {
989  @Consume stack: NavPathStack;
990  @State name: string = 'NA';
991
992  build() {
993    NavDestination() {
994      DestBody({
995        name: this.name
996      })
997    }
998    .title(this.name)
999    .onReady((context) => {
1000      this.name = context.pathInfo.name
1001    })
1002    .systemTransition(NavigationSystemTransitionType.EXPLODE)
1003  }
1004}
1005
1006@Component
1007struct SlideRight {
1008  @Consume stack: NavPathStack;
1009  @State name: string = 'NA';
1010
1011  build() {
1012    NavDestination() {
1013      DestBody({
1014        name: this.name
1015      })
1016    }
1017    .title(this.name)
1018    .onReady((context) => {
1019      this.name = context.pathInfo.name
1020    })
1021    .systemTransition(NavigationSystemTransitionType.SLIDE_RIGHT)
1022  }
1023}
1024
1025@Component
1026struct SlideBottom {
1027  @Consume stack: NavPathStack;
1028  @State name: string = 'NA';
1029
1030  build() {
1031    NavDestination() {
1032      DestBody({
1033        name: this.name
1034      })
1035    }
1036    .title(this.name)
1037    .onReady((context) => {
1038      this.name = context.pathInfo.name
1039    })
1040    .systemTransition(NavigationSystemTransitionType.SLIDE_BOTTOM)
1041  }
1042}
1043
1044@Component
1045struct DestBody {
1046  name: string = 'NA'
1047
1048  columnTextSize: number = 22
1049  columnTextFontWeight: FontWeight = FontWeight.Bolder
1050  columnWidth: string = '65%'
1051  columnPadding: number = 22
1052  columnMargin: number = 10
1053  columnBorderRadius: number = 10
1054
1055  build() {
1056    Column() {
1057      Column()
1058        .width('85')
1059        .height(50)
1060        .backgroundColor(Color.White)
1061      Column() {
1062        Text(this.name)
1063          .fontSize(this.columnTextSize)
1064          .fontWeight(this.columnTextFontWeight)
1065      }
1066      .width(this.columnWidth)
1067      .padding(this.columnPadding)
1068      .margin(this.columnMargin)
1069      .borderRadius(this.columnBorderRadius)
1070      .shadow(ShadowStyle.OUTER_DEFAULT_LG)
1071    }
1072  }
1073}
1074
1075@Component
1076struct HomeBody {
1077  @Consume stack: NavPathStack;
1078  @Consume homePageTransitionType: NavigationSystemTransitionType;
1079
1080  columnTextSize: number = 22
1081  columnTextFontWeight: FontWeight = FontWeight.Bolder
1082  columnWidth: string = '85%'
1083  columnPadding: number = 22
1084  columnMargin: number = 10
1085  columnBorderRadius: number = 10
1086  columnShadow: ShadowStyle = ShadowStyle.OUTER_DEFAULT_MD
1087
1088  build() {
1089    Column() {
1090      Search({ value: 'Search' })
1091        .width(this.columnWidth)
1092
1093      Column() {
1094        Text('fade')
1095          .fontSize(this.columnTextSize)
1096          .fontWeight(this.columnTextFontWeight)
1097      }
1098      .width(this.columnWidth)
1099      .padding(this.columnPadding)
1100      .margin(this.columnMargin)
1101      .borderRadius(this.columnBorderRadius)
1102      .shadow(this.columnShadow)
1103      .onClick(() => {
1104        this.homePageTransitionType = NavigationSystemTransitionType.FADE
1105        this.stack.pushPath({name: 'Fade'})
1106      })
1107
1108      Column() {
1109        Text('explode')
1110          .fontSize(this.columnTextSize)
1111          .fontWeight(this.columnTextFontWeight)
1112      }
1113      .width(this.columnWidth)
1114      .padding(this.columnPadding)
1115      .margin(this.columnMargin)
1116      .borderRadius(this.columnBorderRadius)
1117      .shadow(this.columnShadow)
1118      .onClick(() => {
1119        this.homePageTransitionType = NavigationSystemTransitionType.EXPLODE
1120        this.stack.pushPath({name: 'Explode'})
1121      })
1122
1123      Column() {
1124        Text('slide right')
1125          .fontSize(this.columnTextSize)
1126          .fontWeight(this.columnTextFontWeight)
1127      }
1128      .width(this.columnWidth)
1129      .padding(this.columnPadding)
1130      .margin(this.columnMargin)
1131      .borderRadius(this.columnBorderRadius)
1132      .shadow(this.columnShadow)
1133      .onClick(() => {
1134        this.homePageTransitionType = NavigationSystemTransitionType.SLIDE_RIGHT
1135        this.stack.pushPath({name: 'SlideRight'})
1136      })
1137
1138      Column() {
1139        Text('slide bottom')
1140          .fontSize(this.columnTextSize)
1141          .fontWeight(this.columnTextFontWeight)
1142      }
1143      .width(this.columnWidth)
1144      .padding(this.columnPadding)
1145      .margin(this.columnMargin)
1146      .borderRadius(this.columnBorderRadius)
1147      .shadow(this.columnShadow)
1148      .onClick(() => {
1149        this.homePageTransitionType = NavigationSystemTransitionType.SLIDE_BOTTOM
1150        this.stack.pushPath({name: 'SlideBottom'})
1151      })
1152    }
1153  }
1154}
1155```
1156![navdestination_fade](figures/navdestination_fade_transition.gif)
1157![navdestination_explode](figures/navdestination_explode_transition.gif)
1158![navdestination_slide_bottom](figures/navdestination_slide_bottom_transition.gif)
1159![navdestination_slide_right](figures/navdestination_slide_right_transition.gif)
1160
1161For more usage of the **NavDestination** component, see [Example in Navigation](ts-basic-components-navigation.md#example).
1162