<tdclass="cellrowborder"valign="top"width="55.300000000000004%"headers="mcps1.1.5.1.4 "><pid="p102929286918"><aname="p102929286918"></a><aname="p102929286918"></a>Used for the transition of shared elements and takes effect only when it is configured. <strongid="b159773615015"><aname="b159773615015"></a><aname="b159773615015"></a>list-item</strong>, <strongid="b7597036606"><aname="b7597036606"></a><aname="b7597036606"></a>image</strong>, <strongid="b14597153611017"><aname="b14597153611017"></a><aname="b14597153611017"></a>text</strong>, <strongid="b4597183614014"><aname="b4597183614014"></a><aname="b4597183614014"></a>button</strong>, <strongid="b115983361506"><aname="b115983361506"></a><aname="b115983361506"></a>label</strong> components are supported for the transition of shared elements.</p>
<tdclass="cellrowborder"valign="top"width="42.260000000000005%"headers="mcps1.1.5.1.4 "><pid="p197971335193"><aname="p197971335193"></a><aname="p197971335193"></a>Entry style of a shared element during transition.</p>
<aname="ul27978351494"></a><aname="ul27978351494"></a><ulid="ul27978351494"><li><strongid="b1213145515110"><aname="b1213145515110"></a><aname="b1213145515110"></a>exchange</strong> (default): The source page element is moved to the position of the target page element and is zoomed in or out properly.</li><li><strongid="b17991612320"><aname="b17991612320"></a><aname="b17991612320"></a>static</strong>: The position of the target page element remains unchanged. You can configure the transparency animation. Currently, only the static effect configured on the target page takes effect.</li></ul>
<td class="cellrowborder" valign="top" width="42.260000000000005%" headers="mcps1.1.5.1.4 "><p id="p1779714351097"><a name="p1779714351097"></a><a name="p1779714351097"></a>During the transition, the style configured on the target page takes effect preferentially. This style is used to configure the animation effect of shared elements. The animation effect is an animation sequence defined by @keyframes supporting transform and transparency animations. If the effect of the shared element conflicts with the custom animation, the latter is used.</p>
<tdclass="cellrowborder"valign="top"width="42.260000000000005%"headers="mcps1.1.5.1.4 "><pid="p37974351492"><aname="p37974351492"></a><aname="p37974351492"></a>During the transition, the style configured on the target page takes effect preferentially. This property defines the difference curve during the transition of shared elements. If this parameter is not configured, the friction curve is used by default.</p>
</td>
</tr>
</tbody>
</table>
### Important Notes<a name="section181291131395"></a>
1. If shared element transition style and customized page transition style are both configured, the latter is used.
2. The exchange effect of the shared element is similar to the transition shown in the following figure.
**Figure 1** Default transition effect of shared elements<aname="fig85705915913"></a>
> Supported since API version 4. Updates will be marked with a superscript to indicate their earliest API version.
## Transition of Shared Elements
### Attributes
| Name| Type| Default Value| Description|
| -------- | -------- | -------- | -------- |
| shareid | string | -| Used for the transition of shared elements and takes effect only when it is configured.**list-item**, **image**, **text**, **button**, and **label** components are supported for the transition of shared elements.|
### Styles
| Name| Type| Default Value| Description|
| -------- | -------- | -------- | -------- |
| shared-transition-effect | string | exchange | Entry style of a shared element during transition.<br>- **exchange** (default): The source page element is moved to the position of the target page element and is zoomed in or out properly.<br>- **static**: The position of the target page element remains unchanged. You can configure the opacity animation. Currently, only the static effect configured on the target page takes effect.|
| shared-transition-name | string | - | During the transition, the style configured on the target page takes effect preferentially. This style is used to configure the animation effect of shared elements. The animation effect is an animation sequence defined by **@keyframes** supporting transform and opacity animations. If the effect of shared elements conflicts with the custom animation, the latter is used.|
| shared-transition-timing-function | string | friction | During the transition, the style configured on the target page takes effect preferentially. This style defines the difference curve during the transition of shared elements. If it is not configured, the friction curve is used.|
### Important Notes
1. If the shared element transition style and custom page transition style are both configured, the latter is used.
2. The exchange effect of shared elements is similar to the transition shown below.
**Figure 1** Default transition effect of shared elements
3. The animation of a shared element does not take effect for the border and background color of the element.
4. During the transition of a shared element, the page element is hidden. Therefore, the animation style and function set for the page element are invalid.
5. During the dynamic change of **shareid**<sup>5+</sup>, if the **shareid** value in component A is overwritten by that in component B, the shared element effect of component A becomes ineffective and will not be restored even if the **shareid** value is changed in component B.
5. During the dynamic change of **shareid**<sup>5+</sup>, if the **shareid** value in component A is overwritten by that in component B, the shared element effect of component A becomes ineffective and will not be restored even if the **shareid** value is changed in component B.
### Example<a name="section11396118910"></a>
### Example
Page A jumps to Page B. The shared element is **image**, and the **shareid** is "shareImage".
In the example below, where **PageA** jumps to **PageB**, the shared element is **image**, and the **shareid** is "shareImage".
```
<!-- PageA -->
...
...
@@ -98,10 +48,8 @@ Page A jumps to Page B. The shared element is **image**, and the **shareid**
<tdclass="cellrowborder"valign="top"width="32.62%"headers="mcps1.1.5.1.4 "><pid="p6840173431412"><aname="p6840173431412"></a><aname="p6840173431412"></a>Whether a component on the current page displays the transition effect during a card transition. Available values are as follows:</p>
<aname="ul188401834121413"></a><aname="ul188401834121413"></a><ulid="ul188401834121413"><li><strongid="b11897457195815"><aname="b11897457195815"></a><aname="b11897457195815"></a>unfold</strong>: The component will move upwards by one card height if the component locates above the card tapped by users, or move downwards by one card height if the component locates below the card.</li><li><strongid="b4547119463"><aname="b4547119463"></a><aname="b4547119463"></a>none</strong>: No transition effect is displayed.</li></ul>
</td>
</tr>
</tbody>
</table>
### Example<a name="section13120105991118"></a>
The **source\_page** has a title area on the top and a card list. Users can tap a card to switch to the **target\_page**.
> Card transitions are not available when other transitions (including shared element transitions and custom transitions) are used.
### Styles
| Name| Type| Default Value| Description|
| -------- | -------- | -------- | -------- |
| transition-effect | string | - | Whether a component on the current page displays the transition effect during a card transition. Available values are as follows:<br>- **unfold**: The component will move upwards by one card height if the component is located above the card tapped by the user, or move downwards by one card height if the component is located below the card.<br>- **none**: No transition effect is displayed.|
### Example
The **source_page** has a title area on the top and a card list. Users can tap a card to switch to the **target_page**.
<td class="cellrowborder" valign="top" width="32.62%" headers="mcps1.1.5.1.4 "><p id="p1581715188146"><a name="p1581715188146"></a><a name="p1581715188146"></a>Related to @keyframes, which supports transform and transparent animations. For details, see <a href="js-components-common-animation.md#t48a722bba37a44c883ed4e046a4cf82e">Table 2</a>.</p>
<td class="cellrowborder" valign="top" width="32.62%" headers="mcps1.1.5.1.4 "><p id="p4817121818148"><a name="p4817121818148"></a><a name="p4817121818148"></a>Related to @keyframes, which supports transform and transparent animations. For details, see <a href="js-components-common-animation.md#t48a722bba37a44c883ed4e046a4cf82e">Table 2</a>.</p>
<tdclass="cellrowborder"valign="top"width="28.410000000000004%"headers="mcps1.1.5.1.3 "><pid="p1881716183145"><aname="p1881716183145"></a><aname="p1881716183145"></a>Follows the default page transition time of the device.</p>
</td>
<tdclass="cellrowborder"valign="top"width="32.62%"headers="mcps1.1.5.1.4 "><pid="p118179184142"><aname="p118179184142"></a><aname="p118179184142"></a>The unit can be s or ms. The default unit is ms. If no value is specified, the default value is used.</p>
<tdclass="cellrowborder"valign="top"width="32.62%"headers="mcps1.1.5.1.4 "><pid="p5818118101412"><aname="p5818118101412"></a><aname="p5818118101412"></a>Speed curve of executing transition animation for smoother transition. For details about the parameters, see the description of the valid values of <strongid="b208543341576"><aname="b208543341576"></a><aname="b208543341576"></a>animation-timing-function</strong> in <ahref="js-components-common-animation.md">Animation Styles</a>.</p>
</td>
</tr>
</tbody>
</table>
### Important Notes<a name="section16968142012132"></a>
1. When you set a customized transition, set the background color of the page to an opaque color. Otherwise, the transition effect can be harsh.
2. The **transition-enter** and **transition-exit** parameters can be configured separately. The default parameters are used if they are not configured.
3. Notes on the **transition-enter** and **transition-exit** parameters:
1. In the push scenario, enter the animation described by **transition-enter** of the **Page2.js** application in the page stack; enter the animation described by **transition-exit** of the **Page1.js** application in the second position of the page stack.
![](figures/en-us_image_0000001193704354.png)
2. In the back scenario, exit the animation described by **transition-enter** of the **Page2.js** application in the page stack and play the animation in reverse sequence; exit the animation described by **transition-exit** of the Page1.js application in the second position of the page stack and play the animation in reverse sequence.
| transition-enter | string | - | Works with **@keyframes** and supports transform and opacity animations. For details, see [Attributes available for the @keyframes rule](../arkui-js/js-components-common-animation.md).|
| transition-exit | string | - | Works with **@keyframes** and supports transform and opacity animations. For details, see [Attributes available for the @keyframes rule](../arkui-js/js-components-common-animation.md).|
| transition-duration | string | Follows the default page transition time of the device| The unit can be s or ms. The default unit is ms. If no value is specified, the default value is used. |
| transition-timing-function | string | friction | Speed curve of the transition animation, which makes the animation more fluent. For details, see the description of **animation-timing-function **in [Animation Styles](../arkui-js/js-components-common-animation.md).|
### Important Notes
1. When defining a custom transition, set the page background color to an opaque color. Otherwise, the transition effect can be harsh.
2. The **transition-enter** and **transition-exit** styles can be configured separately. The default settings are used if they are not configured.
3. Notes on the **transition-enter** and **transition-exit** styles:
a. In the push scenario, the animation defined by **transition-enter** is used for entering the **Page2.js** in the page stack; the animation defined by **transition-exit** is used for entering the **Page1.js** in the page stack.
b. In the back scenario, the animation defined by **transition-enter** is used for exiting the **Page2.js** in the page stack, with the animation played in reverse sequence; the animation defined by **transition-exit** is used for exiting the **Page1.js** in the page stack, with the animation played in reverse sequence.