Skip to main content
LayoutAnimation automatically animates views to their new positions when the next layout happens. A common way to use this API is to call it before calling setState.
On Android, you need to enable LayoutAnimation by setting the following flag in your UIManager:

Methods

configureNext()

Schedules an animation to happen on the next layout.
object
required
Specifies animation properties:
number
required
Duration of the animation in milliseconds
object
Configuration for animating in new views
string
Animation type: spring, linear, easeInEaseOut, easeIn, easeOut, or keyboard
string
Property to animate: opacity, scaleX, scaleY, or scaleXY
number
Spring damping coefficient (only for spring type)
object
Configuration for animating views that have been updated
string
Animation type: spring, linear, easeInEaseOut, easeIn, easeOut, or keyboard
number
Spring damping coefficient (only for spring type)
object
Configuration for animating out removed views
string
Animation type: spring, linear, easeInEaseOut, easeIn, easeOut, or keyboard
string
Property to animate: opacity, scaleX, scaleY, or scaleXY
function
Callback called when the animation completes. Guaranteed to be called in Fabric renderer.
function
Callback called on error. Only called in Fabric renderer if configuration parsing fails.

create()

Helper for creating a config for configureNext().
number
required
Duration of the animation in milliseconds
string
Animation type: spring, linear, easeInEaseOut, easeIn, easeOut, or keyboard
string
Property to animate: opacity, scaleX, scaleY, or scaleXY

Preset Methods

easeInEaseOut()

Uses the easeInEaseOut preset (300ms duration, opacity property).

linear()

Uses the linear preset (500ms duration, opacity property).

spring()

Uses the spring preset (700ms duration, spring damping 0.4).

Properties

Types

Available animation types:

Properties

Available animation properties:

Presets

Pre-configured animation presets:

Examples

Basic Usage with setState

Custom Configuration

With Callbacks

Using create() Helper

List Item Addition/Removal

Notes

  • Call LayoutAnimation.configureNext() before setState() or other state updates
  • On Android, LayoutAnimation must be explicitly enabled via UIManager
  • Fabric renderer provides more reliable callback support
  • Works with layout property changes (width, height, position)
  • Does not work with transform properties
  • Can impact performance with complex layouts or many simultaneous animations