ui/ViewManager
A component that manages the transitions of views.
Members
Section titled “Members ”ViewManager Component
Section titled “ViewManager   Component ”A ViewManager controls the visibility of a configurable number of views, allowing for them to be
transitioned on and off the viewport.
Extends:
ui/ViewManagerui/ViewManager.ViewManagerBase
Wrapped with:
ui/ViewManagerui/ViewManager.ViewManagerDecorator
SlideArranger Function
Section titled “SlideArranger   Function ”SlideArranger( config ) → ArrangerA basic arranger factory that must be configured with direction and optionally an amount.
1 Param
- config Object
Configuration object.
- amount Object
Amount, as a whole number, to "slide" where 100 is the entire size of the node along the axis of the
direction.- direction 'bottom' | 'left' | 'right' | 'top'
Direction from which the view will transition.
Object keys for config
Returns
- Arranger
An arranger
SlideBottomArranger Arranger
Section titled “SlideBottomArranger   Arranger ”An arranger that enters from the top and leaves to the bottom.
SlideLeftArranger Arranger
Section titled “SlideLeftArranger   Arranger ”An arranger that enters from the right and leaves to the left.
SlideRightArranger Arranger
Section titled “SlideRightArranger   Arranger ”An arranger that enters from the left and leaves to the right.
SlideTopArranger Arranger
Section titled “SlideTopArranger   Arranger ”An arranger that enters from the bottom and leaves to the top.
ViewManagerBase Component
Section titled “ViewManagerBase   Component ”The base ViewManager component, without
ui/ViewManagerui/ViewManager.ViewManagerDecorator applied.
Properties
arranger
Section titled “arranger”Arranger to control the animation
childProps
Section titled “childProps”An object containing properties to be passed to each child.
children
Section titled “children”Views to be managed.
May be any renderable component including custom React components or primitive DOM nodes.
Type of component wrapping the children. May be a DOM node or a custom React component.
Default: 'div'Called with a reference to the root component.
When using ui/ViewManagerui/ViewManager.ViewManager, the ref prop is forwarded to this
component as componentRef.
duration
Section titled “duration”Time in milliseconds to complete a transition
Default: 300Index of last visible view.
Defaults to the current value of index.
enteringDelay
Section titled “enteringDelay”Time, in milliseconds, to wait after a view has entered to inform it by pass the
enteringProp as false.
enteringProp
Section titled “enteringProp”Name of the property to pass to the wrapped view to indicate when it is entering the viewport.
When true, the view has been created but has not transitioned into place.
When false, the view has finished its transition.
The notification can be delayed by setting enteringDelay. If not set, the view will not
be notified of the change in transition.
Index of active view
Default: 0noAnimation
Section titled “noAnimation”Indicates if the transition should be animated
Default: falseonAppear
Section titled “onAppear”Called when each view is rendered during initial construction.
onEnter
Section titled “onEnter”Called when each view completes its transition into the viewport.
onLeave
Section titled “onLeave”Called when each view completes its transition out of the viewport.
onStay
Section titled “onStay”Called when each view completes its transition within the viewport.
onTransition
Section titled “onTransition”Called once when all views have completed their transition.
onWillTransition
Section titled “onWillTransition”Called once before views begin their transition.
reverseTransition
Section titled “reverseTransition”Explicitly sets the transition direction.
If omitted, the direction is determined automatically based on the change of index or a string comparison of the first child's key.
Indicates the current locale uses right-to-left reading order.
rtl is passed to the arranger in order to alter the animation (e.g. reversing the
horizontal direction).
Index of first visible view. Defaults to the current value of index.
ViewManagerDecorator Higher-Order Component
Section titled “ViewManagerDecorator   Higher-Order Component ”Applies ViewManager behaviors.
Includes:
ui/ForwardRefui/ForwardRef.ForwardRef
Type Definitions
Section titled “Type Definitions ”Arranger Object
Section titled “Arranger   Object ”An object with callback functions to arrange views within ui/ViewManagerui/ViewManager.ViewManager.
Returns an array of keyframes describing the animation when a view is entering the viewport.
Returns an array of keyframes describing the animation when a view is leaving the viewport.
Returns an array of keyframes describing the animation when a view is remaining in the viewport.
ArrangerCallback Function
Section titled “ArrangerCallback   Function ”ArrangerCallback(config)
Section titled “ArrangerCallback(config)”A function that generates an animation for a given transition configuration
1 Param
- config Object
Animation configuration object.
- duration Number
Duration of the animation in ms.
- fill 'forwards' | 'backwards' | 'both' | 'none'
Animation effect should be reflected by previous state or retained after animation.
- from Number
Index from which the ViewManager is transitioning.
- node Node
DOM node to be animated.
- reverse Boolean
truewhen the animation should be reversed.- rtl Boolean
truewhen the ViewManager was configured withrtlfor locales that use right-to-left reading order.- to Number
Index to which the ViewManager is transitioning.
Object keys for config
Returns
- Animation
An
Animation-compatible object