UNPKG

1.61 kBTypeScriptView Raw
1import * as React from 'react';
2import { Omit } from '@material-ui/types';
3import { Theme } from '../styles/createTheme';
4import { TransitionProps } from '../transitions/transition';
5
6export interface GrowProps extends Omit<TransitionProps, 'timeout'> {
7 /**
8 * A single child content element.
9 */
10 children?: React.ReactElement<any, any>;
11 /**
12 * Enable this prop if you encounter 'Function components cannot be given refs',
13 * use `unstable_createStrictModeTheme`,
14 * and can't forward the ref in the child component.
15 */
16 disableStrictModeCompat?: boolean;
17 /**
18 * If `true`, show the component; triggers the enter or exit animation.
19 */
20 in?: boolean;
21 ref?: React.Ref<unknown>;
22 /**
23 * The duration for the transition, in milliseconds.
24 * You may specify a single timeout for all transitions, or individually with an object.
25 *
26 * Set to 'auto' to automatically calculate transition time based on height.
27 */
28 timeout?: TransitionProps['timeout'] | 'auto';
29}
30
31/**
32 * The Grow transition is used by the [Tooltip](https://mui.com/components/tooltips/) and
33 * [Popover](https://mui.com/components/popover/) components.
34 * It uses [react-transition-group](https://github.com/reactjs/react-transition-group) internally.
35 * Demos:
36 *
37 * - [Popover](https://mui.com/components/popover/)
38 * - [Transitions](https://mui.com/components/transitions/)
39 *
40 * API:
41 *
42 * - [Grow API](https://mui.com/api/grow/)
43 * - inherits [Transition API](https://reactcommunity.org/react-transition-group/transition#Transition-props)
44 */
45export default function Grow(props: GrowProps): JSX.Element;