Entering motion
A set of legacy utilities to apply motion in your application.Caution
The FadeIn, SlideIn, ZoomIn and ShrinkOut entering motions will soon be deprecated. Please use the new Motion component instead.
<FadeIn />
Useful for fading in one or more elements.
| Description | Children as |
|---|---|
| Type | (opts: { className: string; style: Record<string, any>; ref: React.Ref<any>; }, state: Transition) => React.ReactNode |
| Description | The distance the element moves in a direction-based animation.
A |
|---|---|
| Default | "proportional" |
| Type | "constant" | "proportional" |
| Description | How long the motion will take. |
|---|---|
| Default | "large" |
| Type | "none" | "small" | "medium" | "large" |
| Description | The direction the element will enter from using a slide animation. If undefined, no slide will be applied. |
|---|---|
| Type | "top" | "right" | "bottom" | "left" |
| Description | The direction the element will exit to using a slide animation.
If undefined but |
|---|---|
| Type | "top" | "right" | "bottom" | "left" |
| Description | Can be used to pause the animation before it has finished. |
|---|---|
| Type | boolean |
| Description | Will callback when the motion has finished in the particular direction.
If it finished entering direction will be |
|---|---|
| Type | (state: Transition) => void |
<SlideIn />
Will slide an element into position, generally used for things that appear from outside of the viewport into view.
| Description | A custom function used to override the default animation timings. Returns which animation curve to use depending on the current transitioning state. |
|---|---|
| Default | "ease-out" |
| Type | "linear" | "ease-in" | "ease-out" | "ease-in-out" | "ease-in-40-out" | "ease-in-60-out" | "ease-in-80-out" |
| Description | A custom function used to override the default animation timings when exiting. Returns which animation curve to use depending on the current transitioning state. |
|---|---|
| Default | "ease-in" |
| Type | "linear" | "ease-in" | "ease-out" | "ease-in-out" | "ease-in-40-out" | "ease-in-60-out" | "ease-in-80-out" |
| Description | Children as |
|---|---|
| Type | (opts: { className: string; style: Record<string, any>; ref: React.Ref<any>; }, state: Transition) => React.ReactNode |
| Description | How long the motion will take. |
|---|---|
| Default | "medium" |
| Type | "none" | "small" | "medium" | "large" |
| Description | Direction the element will slide in from.
E.g. If |
|---|---|
| Type | "top" | "right" | "bottom" | "left" |
| Description | Direction the element will slide out towards.
E.g. If this is not set, exiting will reverse the entrance motion.
E.g. If |
|---|---|
| Type | "top" | "right" | "bottom" | "left" |
| Description | Whether an element will fade on enter, on exit or both.
|
|---|---|
| Type | "none" | "in" | "out" | "inout" |
| Description | Can be used to pause the animation before it has finished. |
|---|---|
| Type | boolean |
| Description | Will callback when the motion has finished in the particular direction.
If it finished entering direction will be |
|---|---|
| Type | (state: Transition) => void |
<ZoomIn />
Will over zoom an element into position.
| Description | Children as |
|---|---|
| Type | (opts: { className: string; style: Record<string, any>; ref: React.Ref<any>; }, state: Transition) => React.ReactNode |
| Description | How long the motion will take. |
|---|---|
| Default | "small" |
| Type | "none" | "small" | "medium" | "large" |
| Description | Can be used to pause the animation before it has finished. |
|---|---|
| Type | boolean |
| Description | Will callback when the motion has finished in the particular direction.
If it finished entering direction will be |
|---|---|
| Type | (state: Transition) => void |
<ShrinkOut />
Will shrink an element down to nothing when exiting. Works best with flex children as collapsing margins can come with undesired behavior.
| Description | Children as |
|---|---|
| Type | (opts: { ref: React.Ref<any>; }, state: Transition) => React.ReactNode |
| Description | How long the motion will take. |
|---|---|
| Default | "small" |
| Type | "none" | "small" | "medium" | "large" |
| Description | Will callback when the motion has finished in the particular direction.
If it finished entering direction will be |
|---|---|
| Type | (state: Transition) => void |