UNPKG

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