1e41f4b71Sopenharmony_ci# Implicit Shared Element Transition (geometryTransition) 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## geometryTransition 12e41f4b71Sopenharmony_ci 13e41f4b71Sopenharmony_cigeometryTransition(id: string) 14e41f4b71Sopenharmony_ci 15e41f4b71Sopenharmony_ciImplements an implicit shared element transition. 16e41f4b71Sopenharmony_ci 17e41f4b71Sopenharmony_ci**System capability**: SystemCapability.ArkUI.ArkUI.Full 18e41f4b71Sopenharmony_ci 19e41f4b71Sopenharmony_ci**Parameters** 20e41f4b71Sopenharmony_ci 21e41f4b71Sopenharmony_ci| Name | Type | Mandatory| Description | 22e41f4b71Sopenharmony_ci| ------- | ------------------------ | ---- | ------------------------------------------------------------ | 23e41f4b71Sopenharmony_ci| id | string | Yes | ID used to set up a binding relationship. If this attribute is set to an empty string **""**, the binding relationship is cleared. The value can be dynamically changed to refresh the binding relationship. One ID can be bound to only two components, which function as in and out components.| 24e41f4b71Sopenharmony_ci 25e41f4b71Sopenharmony_ci## geometryTransition<sup>11+<sup> 26e41f4b71Sopenharmony_ci 27e41f4b71Sopenharmony_cigeometryTransition(id: string, options?: GeometryTransitionOptions) 28e41f4b71Sopenharmony_ci 29e41f4b71Sopenharmony_ciImplements an implicit shared element transition. 30e41f4b71Sopenharmony_ci 31e41f4b71Sopenharmony_ci**System capability**: SystemCapability.ArkUI.ArkUI.Full 32e41f4b71Sopenharmony_ci 33e41f4b71Sopenharmony_ci**Parameters** 34e41f4b71Sopenharmony_ci 35e41f4b71Sopenharmony_ci| Name | Type | Mandatory| Description | 36e41f4b71Sopenharmony_ci| ------- | ------------------------ | ---- | ------------------------------------------------------------ | 37e41f4b71Sopenharmony_ci| id | string | Yes | ID used to set up a binding relationship. If this attribute is set to an empty string **""**, the binding relationship is cleared. The value can be dynamically changed to refresh the binding relationship. One ID can be bound to only two components, which function as in and out components.| 38e41f4b71Sopenharmony_ci| options | [GeometryTransitionOptions](#geometrytransitionoptions11) | No | Settings of the implicit shared element transition. | 39e41f4b71Sopenharmony_ci 40e41f4b71Sopenharmony_ci## GeometryTransitionOptions<sup>11+<sup> 41e41f4b71Sopenharmony_ci 42e41f4b71Sopenharmony_ci**System capability**: SystemCapability.ArkUI.ArkUI.Full 43e41f4b71Sopenharmony_ci 44e41f4b71Sopenharmony_ci**Parameters** 45e41f4b71Sopenharmony_ci 46e41f4b71Sopenharmony_ci| Name| Type| Mandatory| Description | 47e41f4b71Sopenharmony_ci| ------ | -------- | ---- | ------------------------------------------------------------ | 48e41f4b71Sopenharmony_ci| follow | boolean | No | Whether to apply the animation to components that are always in the component tree. It is available only in the **if** syntax.<br>Default value: **false**| 49e41f4b71Sopenharmony_ci 50e41f4b71Sopenharmony_ci## Example 51e41f4b71Sopenharmony_ci 52e41f4b71Sopenharmony_ci```ts 53e41f4b71Sopenharmony_ci// xxx.ets 54e41f4b71Sopenharmony_ci@Entry 55e41f4b71Sopenharmony_ci@Component 56e41f4b71Sopenharmony_cistruct Index { 57e41f4b71Sopenharmony_ci @State isShow: boolean = false 58e41f4b71Sopenharmony_ci 59e41f4b71Sopenharmony_ci build() { 60e41f4b71Sopenharmony_ci Stack({ alignContent: Alignment.Center }) { 61e41f4b71Sopenharmony_ci if (this.isShow) { 62e41f4b71Sopenharmony_ci Image($r('app.media.pic')) 63e41f4b71Sopenharmony_ci .autoResize(false) 64e41f4b71Sopenharmony_ci .clip(true) 65e41f4b71Sopenharmony_ci .width(300) 66e41f4b71Sopenharmony_ci .height(400) 67e41f4b71Sopenharmony_ci .offset({ y: 100 }) 68e41f4b71Sopenharmony_ci .geometryTransition("picture") 69e41f4b71Sopenharmony_ci .transition(TransitionEffect.OPACITY) 70e41f4b71Sopenharmony_ci } else { 71e41f4b71Sopenharmony_ci // geometryTransition is bound to a container. Therefore, a relative layout must be configured for the child components of the container. 72e41f4b71Sopenharmony_ci // The multiple levels of containers here are used to demonstrate passing of relative layout constraints. 73e41f4b71Sopenharmony_ci Column() { 74e41f4b71Sopenharmony_ci Column() { 75e41f4b71Sopenharmony_ci Image($r('app.media.icon')) 76e41f4b71Sopenharmony_ci .width('100%').height('100%') 77e41f4b71Sopenharmony_ci }.width('100%').height('100%') 78e41f4b71Sopenharmony_ci } 79e41f4b71Sopenharmony_ci .width(80) 80e41f4b71Sopenharmony_ci .height(80) 81e41f4b71Sopenharmony_ci // geometryTransition synchronizes rounded corner settings, but only for the bound component, which is the container in this example. 82e41f4b71Sopenharmony_ci // In other words, rounded corner settings of the container are synchronized, and those of the child components are not. 83e41f4b71Sopenharmony_ci .borderRadius(20) 84e41f4b71Sopenharmony_ci .clip(true) 85e41f4b71Sopenharmony_ci .geometryTransition("picture") 86e41f4b71Sopenharmony_ci // transition ensures that the component is not destructed immediately when it exits. You can customize the transition effect. 87e41f4b71Sopenharmony_ci .transition(TransitionEffect.OPACITY) 88e41f4b71Sopenharmony_ci } 89e41f4b71Sopenharmony_ci } 90e41f4b71Sopenharmony_ci .onClick(() => { 91e41f4b71Sopenharmony_ci animateTo({ duration: 1000 }, () => { 92e41f4b71Sopenharmony_ci this.isShow = !this.isShow 93e41f4b71Sopenharmony_ci }) 94e41f4b71Sopenharmony_ci }) 95e41f4b71Sopenharmony_ci } 96e41f4b71Sopenharmony_ci} 97e41f4b71Sopenharmony_ci``` 98e41f4b71Sopenharmony_ci 99e41f4b71Sopenharmony_ci 100