Skip to content

TransitionScale ​

TransitionScale animates one or both axes around a configurable transform origin. Existing transforms are preserved.

MTransitionScaleClick this area to replay the transition.
Simplified code
<transition-scale
	axis="both"
	:scale="0.6"
	origin="50% 50%"
>
	<div v-if="isVisible">Content</div>
</transition-scale>
vue
<transition-scale :scale="0.8" origin="50% 0%">
  <div v-if="isVisible">Content</div>
</transition-scale>

Unique props ​

PropAccepted valuesDefault
axis'x', 'y', or 'both''both'
scaleNumber from 0 to 10
originNon-empty CSS transform-origin value'50% 50%'

Each prop can also receive complete enter and leave values:

vue
<transition-scale
  :axis="{ enter: 'x', leave: 'y' }"
  :scale="{ enter: 0.8, leave: 0.4 }"
  :origin="{ enter: '0% 50%', leave: '100% 50%' }"
>
  <div v-if="isVisible">Content</div>
</transition-scale>

Released under the MIT License.