UNPKG

1.49 kBTypeScriptView Raw
1import * as React from 'react';
2import { StyleProp, View, ViewStyle } from 'react-native';
3import type { ThemeProp } from 'src/types';
4export type Props = React.ComponentPropsWithRef<typeof View> & {
5 /**
6 * Content of the `DialogScrollArea`.
7 */
8 children: React.ReactNode;
9 style?: StyleProp<ViewStyle>;
10 /**
11 * @optional
12 */
13 theme?: ThemeProp;
14};
15/**
16 * A component to show a scrollable content in a Dialog. The component only provides appropriate styling.
17 * For the scrollable content you can use `ScrollView`, `FlatList` etc. depending on your requirement.
18 *
19 * ## Usage
20 * ```js
21 * import * as React from 'react';
22 * import { ScrollView } from 'react-native';
23 * import { Dialog, Portal, Text } from 'react-native-paper';
24 *
25 * const MyComponent = () => {
26 * const [visible, setVisible] = React.useState(false);
27 *
28 * const hideDialog = () => setVisible(false);
29 *
30 * return (
31 * <Portal>
32 * <Dialog visible={visible} onDismiss={hideDialog}>
33 * <Dialog.ScrollArea>
34 * <ScrollView contentContainerStyle={{paddingHorizontal: 24}}>
35 * <Text>This is a scrollable area</Text>
36 * </ScrollView>
37 * </Dialog.ScrollArea>
38 * </Dialog>
39 * </Portal>
40 * );
41 * };
42 *
43 * export default MyComponent;
44 * ```
45 */
46declare const DialogScrollArea: {
47 (props: Props): React.JSX.Element;
48 displayName: string;
49};
50export default DialogScrollArea;
51//# sourceMappingURL=DialogScrollArea.d.ts.map
\No newline at end of file