Animation » All animatable properties
All animatable properties
All numerical properties of a layer can be animated, plus a few more things like colors, gradients, and shadows. Here’s the complete list:
Dimensions | width , height , size , scale , scaleX , scaleY , scaleZ |
Position | x , y , z and also minX , midX , maxX , minY , midY , maxY |
Color | backgroundColor , borderColor , shadowColor , color |
Gradient | gradient (to a gradient object, or to start , end , angle properties individually) |
Border | borderColor , borderRadius (and also topLeft , topRight , bottomLeft , bottomRight independently), borderWidth (also top , right , bottom , left independently) |
Rotation | rotation (or rotationZ ), rotationX , rotationY |
Skew | skew , skewX , skewY |
Transform origin | originX , originY , originZ |
Filters | blur , backgroundBlur , brightness , contrast , saturate , grayscale , hueRotate , invert , sepia |
Shadow | shadowX , shadowY , shadowBlur , shadowSpread , shadowColor , shadow1 —shadow9 (to a shadow object, or to color , x , y , blur , spread properties individually), shadows (to another array of shadow objects) |
Opacity | opacity |
3D Perspective | perspective , perspectiveOriginX , perspectiveOriginY |
Scroll Distance | scrollX , scrollY |
Text Layer | padding , color , backgroundColor , fontSize , lineHeight , shadowColor , shadowX , shadowY , shadowBlur , letterSpacing , wordSpacing , textIndent , template (template tags will animate to a number value) |
- The Scroll Distance properties are for animating a ScrollComponent.
The smoothest animations
Pro tip: If your prototype doesn’t animate smoothly, know that these properties will almost always animate without stuttering:
scale
(scaleX
,scaleY
)x
andy
positions (probably alsominX
,midX
, etc.)opacity
They perform best because they are hardware accelerated, they run on the GPU (the graphics card). Most other properties will cause ‘repaints’ (redrawing of the pixels of the layer on the CPU).
So sometimes it can make sense to animate scale
instead of width
and height
, or to animate with opacity instead of between colors.