@atlaskit/motion
Version:
A set of utilities to apply motion in your application.
50 lines (49 loc) • 2.07 kB
TypeScript
import React from 'react';
import { type KeyframesMotionProps } from './keyframes-motion';
import { type AnimationCurve, type Direction, type Fade } from './types';
export interface SlideInProps extends KeyframesMotionProps {
/**
* Direction the element will slide in from.
* E.g. `"right"` will slide in from the right to the left.
*
* If `exitTo` is not set, exiting will reverse this motion.
* E.g. If `enterFrom: "right"`, will slide out to the right.
*/
enterFrom: Direction;
/**
* Direction the element will slide out towards.
* E.g. `"right"` will slide out to the right.
*
* If this is not set, exiting will reverse the entrance motion.
* E.g. If `enterFrom: "right"`, will slide out to the right.
*/
exitTo?: Direction;
/**
* Whether an element will fade on enter, on exit or both.
*
* `'none'` is the default and will cause the element to not fade,
* `'in'` will cause the element to fade on enter,
* `'out'` will cause the element to fade on exit,
* `'inout'` will cause the element to fade on both.
*/
fade?: Fade;
/**
* A custom function used to override the default animation timings.
* Returns which animation curve to use depending on the current transitioning state.
*/
animationTimingFunction?: AnimationCurve;
/**
* A custom function used to override the default animation timings when exiting.
* Returns which animation curve to use depending on the current transitioning state.
*/
animationTimingFunctionExiting?: AnimationCurve;
}
/**
* __SlideIn__
*
* Will slide an element into position, generally used for things that appear from outside of the viewport into view.
*
* See [examples](https://atlaskit.atlassian.com/packages/design-system/motion/docs/entering-motion).
*/
declare const SlideIn: ({ children, enterFrom, exitTo, duration, isPaused, onFinish, animationTimingFunction, animationTimingFunctionExiting, }: SlideInProps) => React.JSX.Element;
export default SlideIn;