UNPKG

1.64 kBTypeScriptView Raw
1import * as React from 'react';
2import { StyleProp, ViewStyle } from 'react-native';
3
4export type EasingMode =
5 | 'linear'
6 | 'easeInQuad'
7 | 'easeOutQuad'
8 | 'easeInOutQuad'
9 | 'easeInCubic'
10 | 'easeOutCubic'
11 | 'easeInOutCubic'
12 | 'easeInQuart'
13 | 'easeOutQuart'
14 | 'easeInOutQuart'
15 | 'easeInQuint'
16 | 'easeOutQuint'
17 | 'easeInOutQuint'
18 | 'easeInSine'
19 | 'easeOutSine'
20 | 'easeInOutSine'
21 | 'easeInExpo'
22 | 'easeOutExpo'
23 | 'easeInOutExpo'
24 | 'easeInCirc'
25 | 'easeOutCirc'
26 | 'easeInOutCirc'
27 | 'easeInElastic'
28 | 'easeOutElastic'
29 | 'easeInOutElastic'
30 | 'easeInBack'
31 | 'easeOutBack'
32 | 'easeInOutBack'
33 | 'easeInBounce'
34 | 'easeOutBounce'
35 | 'easeInOutBounce';
36
37export interface CollapsibleProps {
38 /**
39 * Alignment of the content when transitioning, can be top, center or bottom
40 *
41 * @default top
42 */
43 align?: 'top' | 'center' | 'bottom';
44
45 /**
46 * Whether to show the child components or not
47 *
48 * @default true
49 */
50 collapsed?: boolean;
51
52 /**
53 * Which height should the component collapse to
54 *
55 * @default 0
56 */
57 collapsedHeight?: number;
58
59 /**
60 * Duration of transition in milliseconds
61 *
62 * @default 300
63 */
64 duration?: number;
65
66 /**
67 * Function or function name from Easing (or tween-functions if < RN 0.8). Collapsible will try to combine Easing functions for you if you name them like tween-functions
68 *
69 * @default easeOutCubic
70 */
71 easing?: EasingMode | any;
72
73 /**
74 * Optional styling for the container
75 */
76 style?: StyleProp<ViewStyle>;
77}
78
79export default class Collapsible extends React.Component<
80 CollapsibleProps,
81 any
82> {}