UNPKG

2.09 kBTypeScriptView Raw
1import * as React from 'react';
2import { TransitionProps } from '../transitions/transition';
3
4export interface SlideProps extends TransitionProps {
5 /**
6 * Perform the enter transition when it first mounts if `in` is also `true`.
7 * Set this to `false` to disable this behavior.
8 * @default true
9 */
10 appear?: boolean;
11 /**
12 * A single child content element.
13 */
14 children: React.ReactElement<unknown, any>;
15 /**
16 * An HTML element, or a function that returns one.
17 * It's used to set the container the Slide is transitioning from.
18 */
19 container?: null | Element | ((element: Element) => Element);
20 /**
21 * Direction the child node will enter from.
22 * @default 'down'
23 */
24 direction?: 'left' | 'right' | 'up' | 'down';
25 /**
26 * The transition timing function.
27 * You may specify a single easing or a object containing enter and exit values.
28 * @default {
29 * enter: theme.transitions.easing.easeOut,
30 * exit: theme.transitions.easing.sharp,
31 * }
32 */
33 easing?: TransitionProps['easing'];
34 /**
35 * If `true`, the component will transition in.
36 */
37 in?: TransitionProps['in'];
38 ref?: React.Ref<unknown>;
39 /**
40 * The duration for the transition, in milliseconds.
41 * You may specify a single timeout for all transitions, or individually with an object.
42 * @default {
43 * enter: theme.transitions.duration.enteringScreen,
44 * exit: theme.transitions.duration.leavingScreen,
45 * }
46 */
47 timeout?: TransitionProps['timeout'];
48}
49
50/**
51 * The Slide transition is used by the [Drawer](https://mui.com/material-ui/react-drawer/) component.
52 * It uses [react-transition-group](https://github.com/reactjs/react-transition-group) internally.
53 *
54 * Demos:
55 *
56 * - [Dialog](https://mui.com/material-ui/react-dialog/)
57 * - [Transitions](https://mui.com/material-ui/transitions/)
58 *
59 * API:
60 *
61 * - [Slide API](https://mui.com/material-ui/api/slide/)
62 * - inherits [Transition API](https://reactcommunity.org/react-transition-group/transition/#Transition-props)
63 */
64export default function Slide(props: SlideProps): React.JSX.Element;
65
\No newline at end of file