UNPKG

1.58 kBTypeScriptView Raw
1import * as React from 'react';
2import type { ThemeProp } from 'src/types';
3import { IconSource } from '../Icon';
4export declare type Props = {
5 /**
6 * Custom color for action icon.
7 */
8 color?: string;
9 /**
10 * Name of the icon to show.
11 */
12 icon: IconSource;
13 /**
14 * Optional icon size.
15 */
16 size?: number;
17 /**
18 * @optional
19 */
20 theme?: ThemeProp;
21};
22/**
23 * @supported Available in v5.x with theme version 3
24 * A component to show an icon in a Dialog.
25 *
26 * ## Usage
27 * ```js
28 * import * as React from 'react';
29 * import { StyleSheet } from 'react-native';
30 * import { Dialog, Portal, Text } from 'react-native-paper';
31 *
32 * const MyComponent = () => {
33 * const [visible, setVisible] = React.useState(false);
34 *
35 * const hideDialog = () => setVisible(false);
36 *
37 * return (
38 * <Portal>
39 * <Dialog visible={visible} onDismiss={hideDialog}>
40 * <Dialog.Icon icon="alert" />
41 * <Dialog.Title style={styles.title}>This is a title</Dialog.Title>
42 * <Dialog.Content>
43 * <Text variant="bodyMedium">This is simple dialog</Text>
44 * </Dialog.Content>
45 * </Dialog>
46 * </Portal>
47 * );
48 * };
49 *
50 * const styles = StyleSheet.create({
51 * title: {
52 * textAlign: 'center',
53 * },
54 * })
55 *
56 * export default MyComponent;
57 * ```
58 */
59declare const DialogIcon: {
60 ({ size, color, icon, theme: themeOverrides, }: Props): React.JSX.Element | null;
61 displayName: string;
62};
63export default DialogIcon;
64export { DialogIcon };
65//# sourceMappingURL=DialogIcon.d.ts.map
\No newline at end of file