diff --git a/en/application-dev/reference/arkui-ts/ts-transition-animation-shared-elements.md b/en/application-dev/reference/arkui-ts/ts-transition-animation-shared-elements.md index ce8b999dee711ca5a0b36695c1fed166e41529ab..4c39157590da1869b95471dea321cd72fbd212fe 100644 --- a/en/application-dev/reference/arkui-ts/ts-transition-animation-shared-elements.md +++ b/en/application-dev/reference/arkui-ts/ts-transition-animation-shared-elements.md @@ -1,38 +1,37 @@ # Transition of Shared Elements -> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE** +> **NOTE** > This animationis supported since API version 7. Updates will be marked with a superscript to indicate their earliest API version. -Shared element transition can be used for transition between pages, for example, transition from an image on the current page to the next page. +Transition of shared elements can be used for transition between pages, for example, transition from an image on the current page to the next page. ## Type - | Name | Type | Default Value | Description | +| Name | Type | Default Value | Description | | -------- | -------- | -------- | -------- | -| sharedTransition | id: string,
options?: Object | - | If the same ID is configured for a component on the two pages, this shared component is transited. If this parameter is set to an empty string, no shared elements are transited. | +| sharedTransition | id: string,
options?: Object | - | If the same ID is configured for a component on the two pages, this shared component is transited. If this parameter is set to an empty string, no shared elements are transited. | - options parameters - | Name | Type | Default Value | Mandatory | Description | + | Name | Type | Default Value | Mandatory | Description | | -------- | -------- | -------- | -------- | -------- | - | duration | number | 1000 | No | Animation duration, in ms. The default duration is 1000 ms. | - | curve | Curve \| Curves | Linear | No | The default curve is linear. For details about the valid values, see **Curve enums**. | - | delay | number | 0 | No | Delay of animation playback, in ms. By default, the playback is not delayed. | + | duration | number | 1000 | No | Animation duration, in ms. The default duration is 1000 ms. | + | curve | Curve \| Curves | Linear | No | The default curve is linear. For details about the valid values, see **Curve enums**. | + | delay | number | 0 | No | Delay of animation playback, in ms. By default, the playback is not delayed. | ## Example The example shows the transition of a shared element from a page and page B. - -``` + +```ts +// xxx.ets @Entry @Component struct SharedTransitionExample { - @State scale: number = 1 - @State opacity: number = 1 @State active: boolean = false build() { @@ -55,9 +54,8 @@ struct SharedTransitionExample { } ``` - -``` -// PageB +```ts +// PageB.ets @Entry @Component struct BExample {