Animations
Because RNWeb doesn't support the React Native LayoutAnimation API we need to use other methods for animating our components around the screen. A good alternative is the CSS Transitions API.
Last updated
Was this helpful?
Because RNWeb doesn't support the React Native LayoutAnimation API we need to use other methods for animating our components around the screen. A good alternative is the CSS Transitions API.
Last updated
Was this helpful?
With CSS Animations in React Native (for web) we can create awesome effects with the components on the screen. When you define (at minimum) a component's animationDuration
style property, then any state change that effects that component's style will create an implicit interpolation between the old value and the new one.
The duration to wait before executing the transition associated with a new style value. The value is defined as a string
with the suffix "s" for seconds or "ms" milliseconds.
string | string[]
'0s'
The direction value dictates if an animation should be played forwards, backwards or in alternate cycles.
string | string[]
'normal'
'alternate' | 'alternate-reverse' | 'normal' | 'reverse'
The duration or durations of the animations after the animationDelay
has finished. The value is defined as a string
with the suffix "s" for seconds or "ms" milliseconds.
string | string[]
'0s'
The animationFillMode
CSS property sets how a CSS animation applies styles to its target before and after its execution.
string | string[]
'forwards'
'none' | 'forwards' | 'backwards' | 'both'
The animationIterationCount
CSS property sets the number of times an animation cycle should be played before stopping.
If multiple values are specified, each time the animation is played the next value in the list is used, cycling back to the first value after the last one is used.
number | 'infinite' | Array<number, 'infinite'>
1
<number> | 'infinite'
Used to control the intermediate steps in an animation sequence by defining styles for keyframes (or waypoints) along the animation sequence. This gives more control over the intermediate steps of the animation sequence than transitions.
string | Object | Array<string, Object>
The animationPlayState
CSS property sets whether an animation is running or paused.
Resuming a paused animation will start the animation from where it left off at the time it was paused, rather than starting over from the beginning of the animation sequence.
string | string[]
'running'
'paused' | 'running'
The animationTimingFunction
CSS property sets how an animation progresses through the duration of each cycle.
string | string[]
'normal'
Values: "linear" | "ease" | "ease-in" | "ease-out" | "ease-in-out" | "step-start" | "step-end" | "steps(int,start|end)" | "cubic-bezier(n,n,n,n)"