# Container transition animation

By seamlessly transforming one element into another, you can strengthen the relationship between the two elements, as in the common waterfall flow of clicking a card to jump to the details page.

In order to reduce the development cost, the base library provides container transition animation component to realize the routing effect.

# Effect demonstration

# Methods of Use

Developer tools need to be upgraded to Nightly 1.06.2403222, Base Library Selection 3.4.0

Will need to carry out the excessive elements placed in the <open-container> Inside the component, click <open-container>, when using the navigateTo When you jump to the next page, you transition between its child nodes and the next page.

<open-container
  closed-elevation="{{closedElevation}}"
  closed-border-radius="{{closedBorderRadius}}"
  open-elevation="{{openElevation}}"
  open-border-radius="{openBorderRadius}}" 
  transition-type="{{type}}"
  transition-duration="{{duration}}"
  bind:tap="goDetail" 
>
  <card/>
</open-container>
Page({
   goDetail() {
    wx.navigateTo ({
      url: 'nextPageUrl'
    })
  }
})

# Component properties

attribute type Default value Required Introductions
closed-color string white no Initial Container Background Color
closed-elevation number 0 no Initial Container Shadow Depth Size
closed-border-radius number 0 no Initial container fillet size
middle-color string '' no fadeThrough Transition background color in mode
open-color string white no Container background color in open state
open-elevation number 0 no Container shadow depth in open state
open-border-radius number 0 no Container fillet size in open state
transition-duration number 300 no Animation duration
transition-type string Fade no Type of animation

# Sample code snippet

{% Minicode ('TMOyD8mB7YOB') %}