1e41f4b71Sopenharmony_ci# Implicit Shared Element Transition (geometryTransition) (System API) 2e41f4b71Sopenharmony_ci 3e41f4b71Sopenharmony_ci**GeometryTransition** is used to create a smooth, seamless transition between views. By specifying the frame and position of the in and out components through **GeometryTransition**, you can create a spatial linkage between the transition effects (such as opacity and scale) defined through the **transition** mechanism. In this way, you can guide the visual focus from the previous view (out component) to the new view (in component). 4e41f4b71Sopenharmony_ci 5e41f4b71Sopenharmony_ci> **NOTE** 6e41f4b71Sopenharmony_ci> 7e41f4b71Sopenharmony_ci> This feature is supported since API version 7 and effective since API version 10. Updates will be marked with a superscript to indicate their earliest API version. 8e41f4b71Sopenharmony_ci> 9e41f4b71Sopenharmony_ci> For the settings to take effect, [geometryTransition](ts-transition-animation-geometrytransition.md) must be used together with [animateTo](ts-explicit-animation.md). The animation duration and curve follow the settings in [animateTo](ts-explicit-animation.md). [animation](ts-animatorproperty.md) is not supported. 10e41f4b71Sopenharmony_ci> 11e41f4b71Sopenharmony_ci> This topic describes only the system APIs provided by the module. For details about its public APIs, see [Implicit Shared Element Transition (geometryTransition)](ts-transition-animation-geometrytransition.md). 12e41f4b71Sopenharmony_ci 13e41f4b71Sopenharmony_ci## GeometryTransitionOptions<sup>11+<sup> 14e41f4b71Sopenharmony_ci 15e41f4b71Sopenharmony_ci**System capability**: SystemCapability.ArkUI.ArkUI.Full 16e41f4b71Sopenharmony_ci 17e41f4b71Sopenharmony_ci**Atomic service API**: This API can be used in atomic services since API version 11. 18e41f4b71Sopenharmony_ci 19e41f4b71Sopenharmony_ci**Parameters** 20e41f4b71Sopenharmony_ci 21e41f4b71Sopenharmony_ci| Name| Type| Mandatory| Description | 22e41f4b71Sopenharmony_ci| ------ | -------- | ---- | ------------------------------------------------------------------------- | 23e41f4b71Sopenharmony_ci| hierarchyStrategy<sup>12+<sup> | [TransitionHierarchyStrategy](#transitionhierarchystrategy12) | No | <br>Strategy for the hierarchical position movement of in/out components in the component tree during the shared element transition process.<br>Default value: **TransitionHierarchyStrategy.ADAPTIVE**<br><br>The setting significantly affects the front-to-back overlap relationship of the in/out components in comparison to other components. Exercise caution with it under normal conditions.<br>You are advised to adjust this setting only when there is an error in the component overlap relationship observed during the shared element transition process.<br>**System API**: This is a system API.| 24e41f4b71Sopenharmony_ci 25e41f4b71Sopenharmony_ci## TransitionHierarchyStrategy<sup>12+<sup> 26e41f4b71Sopenharmony_ciEnumerates the strategies for the hierarchical position movement of in/out components in the component tree during the shared element transition process. 27e41f4b71Sopenharmony_ci 28e41f4b71Sopenharmony_ci**System capability**: SystemCapability.ArkUI.ArkUI.Full 29e41f4b71Sopenharmony_ci 30e41f4b71Sopenharmony_ci**Atomic service API**: This API can be used in atomic services since API version 12. 31e41f4b71Sopenharmony_ci 32e41f4b71Sopenharmony_ci**System API**: This is a system API. 33e41f4b71Sopenharmony_ci 34e41f4b71Sopenharmony_ci| Name | Value| Description| 35e41f4b71Sopenharmony_ci| ------ | - | ---- | 36e41f4b71Sopenharmony_ci| NONE | 0 | The in/out components maintain their original hierarchical positions and are affected by the scale and position of their parent components.| 37e41f4b71Sopenharmony_ci| ADAPTIVE | 1 | Relatively lower-level in/out components are promoted to a higher position in the component tree relative to the higher-level in/out components.<br>This mode also causes the promoted components to be decoupled from their parent components, not affected by the scale and position of their parent components.<br>For example, if the in component is at a higher hierarchy level than the out component, in this mode the out component will be decoupled from its own parent component during the animation process and promoted to the hierarchical position of the in component, while the in component's hierarchical position remains unchanged.| 38e41f4b71Sopenharmony_ci 39e41f4b71Sopenharmony_ci## Example 40e41f4b71Sopenharmony_ci 41e41f4b71Sopenharmony_ci```ts 42e41f4b71Sopenharmony_ci// xxx.ets 43e41f4b71Sopenharmony_ci@Entry 44e41f4b71Sopenharmony_ci@Component 45e41f4b71Sopenharmony_cistruct Index { 46e41f4b71Sopenharmony_ci @State isShow: boolean = false 47e41f4b71Sopenharmony_ci 48e41f4b71Sopenharmony_ci build() { 49e41f4b71Sopenharmony_ci Stack({ alignContent: Alignment.Center }) { 50e41f4b71Sopenharmony_ci if (this.isShow) { 51e41f4b71Sopenharmony_ci Image($r('app.media.pic')) 52e41f4b71Sopenharmony_ci .autoResize(false) 53e41f4b71Sopenharmony_ci .clip(true) 54e41f4b71Sopenharmony_ci .width(300) 55e41f4b71Sopenharmony_ci .height(400) 56e41f4b71Sopenharmony_ci .offset({ y: 100 }) 57e41f4b71Sopenharmony_ci .geometryTransition("picture", {hierarchyStrategy: TransitionHierarchyStrategy.ADAPTIVE}) 58e41f4b71Sopenharmony_ci .transition(TransitionEffect.OPACITY) 59e41f4b71Sopenharmony_ci } else { 60e41f4b71Sopenharmony_ci // geometryTransition is bound to a container. Therefore, a relative layout must be configured for the child components of the container. 61e41f4b71Sopenharmony_ci // The multiple levels of containers here are used to demonstrate passing of relative layout constraints. 62e41f4b71Sopenharmony_ci Column() { 63e41f4b71Sopenharmony_ci Column() { 64e41f4b71Sopenharmony_ci Image($r('app.media.icon')) 65e41f4b71Sopenharmony_ci .width('100%').height('100%') 66e41f4b71Sopenharmony_ci }.width('100%').height('100%') 67e41f4b71Sopenharmony_ci } 68e41f4b71Sopenharmony_ci .width(80) 69e41f4b71Sopenharmony_ci .height(80) 70e41f4b71Sopenharmony_ci // geometryTransition synchronizes rounded corner settings, but only for the bound component, which is the container in this example. 71e41f4b71Sopenharmony_ci // In other words, rounded corner settings of the container are synchronized, and those of the child components are not. 72e41f4b71Sopenharmony_ci .borderRadius(20) 73e41f4b71Sopenharmony_ci .clip(true) 74e41f4b71Sopenharmony_ci .geometryTransition("picture", {hierarchyStrategy: TransitionHierarchyStrategy.ADAPTIVE}) 75e41f4b71Sopenharmony_ci // transition ensures that the component is not destructed immediately when it exits. You can customize the transition effect. 76e41f4b71Sopenharmony_ci .transition(TransitionEffect.OPACITY) 77e41f4b71Sopenharmony_ci } 78e41f4b71Sopenharmony_ci } 79e41f4b71Sopenharmony_ci .onClick(() => { 80e41f4b71Sopenharmony_ci animateTo({ duration: 1000 }, () => { 81e41f4b71Sopenharmony_ci this.isShow = !this.isShow 82e41f4b71Sopenharmony_ci }) 83e41f4b71Sopenharmony_ci }) 84e41f4b71Sopenharmony_ci } 85e41f4b71Sopenharmony_ci} 86e41f4b71Sopenharmony_ci``` 87