Documentation

Animations

Entrance, exit, and state animations with the animate-* class syntax.

Animations

motionwind-react-native uses the same class syntax as the web package. All animation classes start with animate- followed by a gesture prefix and property-value pair.

Class syntax

animate-{gesture}:{property}-{value}
  • gesture: When the animation triggers (enter, initial, exit, tap, inview, etc.)
  • property: What to animate (opacity, scale, y, rotate, etc.)
  • value: The target value (0, 95, 20, 45, etc.)

Entrance animations

Use animate-initial: to set the starting state and animate-enter: for the target state. The animation runs automatically when the component mounts.

Fade in

Fade InNative
9:41

Slide up + fade

Slide Up + FadeNative
9:41

Scale in with spring

Scale In — Spring PhysicsNative
9:41

Slide from left

Slide from LeftNative
9:41

Animatable properties

Transform

ClassPropertyExampleNotes
scale-{n}scalescale-110 → 1.1Values 0–200, divided by 100
scale-x-{n}scaleXscale-x-120 → 1.2
scale-y-{n}scaleYscale-y-80 → 0.8
rotate-{n}rotaterotate-45"45deg"Auto-converts to deg string
rotate-x-{n}rotateXrotate-x-180"180deg"
rotate-y-{n}rotateYrotate-y-90"90deg"
x-{n}translateXx-20 → 20Pixels. Maps to RN translateX
y-{n}translateYy-30 → 30Pixels. Maps to RN translateY

Visual

ClassPropertyExampleNotes
opacity-{n}opacityopacity-50 → 0.5Values 0–100, divided by 100
bg-{color}backgroundColorbg-#ff0000Hex, rgb(), rgba(), hsl()
text-{color}colortext-#ffffff

Dimensions & Layout

ClassPropertyExample
w-{n}widthw-200 → 200px
h-{n}heighth-100 → 100px
rounded-{n}borderRadiusrounded-16 → 16
p-{n}paddingp-20 → 20
m-{n}marginm-10 → 10

Negative values

Prefix any value with - for negative numbers:

<mw.View className="animate-enter:y-0 animate-initial:-y-50">
  <Text>Slides down from above</Text>
</mw.View>

Keyframe arrays

Animate through multiple values using bracket syntax:

Keyframe ScaleNative
9:41

Combining multiple properties

Chain as many properties as you need on the same gesture:

Complex EntranceNative
9:41

Web-only properties (not supported)

These properties are supported on web but silently ignored on React Native:

  • blur-*, brightness-*, contrast-*, saturate-* (CSS filters)
  • backdrop-blur-* (backdrop filter)
  • clip-* (clip-path)
  • shadow-* (box-shadow)
  • path-length-*, path-offset-*, path-spacing-* (SVG)

This means you can share className strings between web and native — unsupported props are dropped without errors.

Next steps