Skip to main content
Use style.transition for ordinary style changes caused by React state when no native gesture lifecycle is involved. Do not use it as the pressed or selected interaction contract. Wrap interactive content in gestureDetector and use shared values when feedback is gesture-driven, interruptible, or needs to be cancelled or awaited.

Simple transitions

Use a transition when React state changes a style value and no imperative animation control is needed.
This is appropriate for a regular state-driven visibility change. For pressed or selected feedback, use gestureDetector and shared values so the visual state follows the native gesture lifecycle.

Shared values

Use sv or sharedValue for a mutable value that updates outside normal React render flow.
Always read and write .value. Assigning a number or color updates immediately; assigning an animation handle starts an animation.

Timing animation

timing moves a value to a target over a duration using an easing curve.

Spring animation

spring is useful for physical movement and settling after a gesture.

Decay animation

withDecay continues movement from an initial velocity and can stop at bounds.

Delay, sequence, and repeat

Use composition helpers when multiple animations form one behavior.
withRepeat repeats an animation directly. repeat creates a reusable factory. Create fresh handles for each run.

Keyframes

Use keyframes for multiple stops with different values or easing per segment.

Derived values

Derived values update automatically from other reactive values and cannot be assigned directly.
add and multiply combine reactive values into another derived value.

Gesture-driven animation

Use mapEvent for high-frequency event fields and settle the value with spring when the gesture ends.

Awaiting and cancelling

Use promise helpers when the next action depends on completion.
runAnimation resolves with an AnimationResult. runAnimationOrThrow rejects with AnimationCompletionError when the animation does not finish naturally. Use cancelAnimation(value) when you need to stop an active animation explicitly.

Completion reasons

Callbacks and promise helpers report:
  • completed: reached the target naturally.
  • cancelled: stopped with cancelAnimation.
  • replaced: another animation took over the same value.
  • overwritten: a direct .value assignment replaced the animation.

Best practices

  • Prefer style.transition for ordinary state-driven visual changes, not pressed or selected feedback that depends on a native gesture lifecycle.
  • Use mapEvent for high-frequency gesture and scroll updates.
  • Create fresh animation handles; do not reuse them in multiple compositions.
  • Cancel or invalidate async animation flows when the component unmounts.
  • Animate only fields supported by animatedProps.