UNPKG

6 kBTypeScriptView Raw
1import * as React from 'react';
2import { View, ViewStyle, StyleProp } from 'react-native';
3declare type Props = React.ComponentPropsWithRef<typeof View> & {
4 /**
5 * Title to show as the header for the section.
6 */
7 title?: string;
8 /**
9 * Content of the `Drawer.Section`.
10 */
11 children: React.ReactNode;
12 style?: StyleProp<ViewStyle>;
13 /**
14 * @optional
15 */
16 theme: ReactNativePaper.Theme;
17};
18declare const _default: (React.ComponentClass<Pick<Props, "ref" | "style" | "title" | "children" | "pointerEvents" | "onLayout" | "testID" | "nativeID" | "accessible" | "accessibilityActions" | "accessibilityLabel" | "accessibilityRole" | "accessibilityState" | "accessibilityHint" | "accessibilityValue" | "onAccessibilityAction" | "accessibilityLiveRegion" | "importantForAccessibility" | "accessibilityElementsHidden" | "accessibilityViewIsModal" | "onAccessibilityEscape" | "onAccessibilityTap" | "onMagicTap" | "accessibilityIgnoresInvertColors" | "key" | "hitSlop" | "removeClippedSubviews" | "collapsable" | "needsOffscreenAlphaCompositing" | "renderToHardwareTextureAndroid" | "focusable" | "shouldRasterizeIOS" | "isTVSelectable" | "hasTVPreferredFocus" | "tvParallaxProperties" | "tvParallaxShiftDistanceX" | "tvParallaxShiftDistanceY" | "tvParallaxTiltAngle" | "tvParallaxMagnification" | "onStartShouldSetResponder" | "onMoveShouldSetResponder" | "onResponderEnd" | "onResponderGrant" | "onResponderReject" | "onResponderMove" | "onResponderRelease" | "onResponderStart" | "onResponderTerminationRequest" | "onResponderTerminate" | "onStartShouldSetResponderCapture" | "onMoveShouldSetResponderCapture" | "onTouchStart" | "onTouchMove" | "onTouchEnd" | "onTouchCancel" | "onTouchEndCapture"> & {
19 /**
20 * A component to group content inside a navigation drawer.
21 *
22 * <div class="screenshots">
23 * <figure>
24 * <img class="medium" src="screenshots/drawer-section.png" />
25 * </figure>
26 * </div>
27 *
28 * ## Usage
29 * ```js
30 * import * as React from 'react';
31 * import { Drawer } from 'react-native-paper';
32 *
33 * const MyComponent = () => {
34 * const [active, setActive] = React.useState('');
35 *
36 *
37 * return (
38 * <Drawer.Section title="Some title">
39 * <Drawer.Item
40 * label="First Item"
41 * active={active === 'first'}
42 * onPress={() => setActive('first')}
43 * />
44 * <Drawer.Item
45 * label="Second Item"
46 * active={active === 'second'}
47 * onPress={() => setActive('second')}
48 * />
49 * </Drawer.Section>
50 * );
51 * };
52 *
53 * export default MyComponent;
54 * ```
55 */
56 theme?: import("@callstack/react-theme-provider").$DeepPartial<ReactNativePaper.Theme> | undefined;
57}, any> & import("@callstack/react-theme-provider/typings/hoist-non-react-statics").NonReactStatics<(React.ComponentClass<Props, any> & {
58 ({ children, title, theme, style, ...rest }: Props): JSX.Element;
59 displayName: string;
60}) | (React.FunctionComponent<Props> & {
61 ({ children, title, theme, style, ...rest }: Props): JSX.Element;
62 displayName: string;
63}), {}>) | (React.FunctionComponent<Pick<Props, "ref" | "style" | "title" | "children" | "pointerEvents" | "onLayout" | "testID" | "nativeID" | "accessible" | "accessibilityActions" | "accessibilityLabel" | "accessibilityRole" | "accessibilityState" | "accessibilityHint" | "accessibilityValue" | "onAccessibilityAction" | "accessibilityLiveRegion" | "importantForAccessibility" | "accessibilityElementsHidden" | "accessibilityViewIsModal" | "onAccessibilityEscape" | "onAccessibilityTap" | "onMagicTap" | "accessibilityIgnoresInvertColors" | "key" | "hitSlop" | "removeClippedSubviews" | "collapsable" | "needsOffscreenAlphaCompositing" | "renderToHardwareTextureAndroid" | "focusable" | "shouldRasterizeIOS" | "isTVSelectable" | "hasTVPreferredFocus" | "tvParallaxProperties" | "tvParallaxShiftDistanceX" | "tvParallaxShiftDistanceY" | "tvParallaxTiltAngle" | "tvParallaxMagnification" | "onStartShouldSetResponder" | "onMoveShouldSetResponder" | "onResponderEnd" | "onResponderGrant" | "onResponderReject" | "onResponderMove" | "onResponderRelease" | "onResponderStart" | "onResponderTerminationRequest" | "onResponderTerminate" | "onStartShouldSetResponderCapture" | "onMoveShouldSetResponderCapture" | "onTouchStart" | "onTouchMove" | "onTouchEnd" | "onTouchCancel" | "onTouchEndCapture"> & {
64 /**
65 * A component to group content inside a navigation drawer.
66 *
67 * <div class="screenshots">
68 * <figure>
69 * <img class="medium" src="screenshots/drawer-section.png" />
70 * </figure>
71 * </div>
72 *
73 * ## Usage
74 * ```js
75 * import * as React from 'react';
76 * import { Drawer } from 'react-native-paper';
77 *
78 * const MyComponent = () => {
79 * const [active, setActive] = React.useState('');
80 *
81 *
82 * return (
83 * <Drawer.Section title="Some title">
84 * <Drawer.Item
85 * label="First Item"
86 * active={active === 'first'}
87 * onPress={() => setActive('first')}
88 * />
89 * <Drawer.Item
90 * label="Second Item"
91 * active={active === 'second'}
92 * onPress={() => setActive('second')}
93 * />
94 * </Drawer.Section>
95 * );
96 * };
97 *
98 * export default MyComponent;
99 * ```
100 */
101 theme?: import("@callstack/react-theme-provider").$DeepPartial<ReactNativePaper.Theme> | undefined;
102}> & import("@callstack/react-theme-provider/typings/hoist-non-react-statics").NonReactStatics<(React.ComponentClass<Props, any> & {
103 ({ children, title, theme, style, ...rest }: Props): JSX.Element;
104 displayName: string;
105}) | (React.FunctionComponent<Props> & {
106 ({ children, title, theme, style, ...rest }: Props): JSX.Element;
107 displayName: string;
108}), {}>);
109export default _default;