UNPKG

2.12 kBTypeScriptView Raw
1import * as React from 'react';
2import type { Animated, ColorValue, StyleProp, View, ViewStyle } from 'react-native';
3import type { ThemeProp } from 'src/types';
4import type { IconSource } from '../Icon';
5import IconButton from '../IconButton/IconButton';
6export type Props = React.ComponentPropsWithoutRef<typeof IconButton> & {
7 /**
8 * Custom color for action icon.
9 */
10 color?: string;
11 /**
12 * Color of the ripple effect.
13 */
14 rippleColor?: ColorValue;
15 /**
16 * Name of the icon to show.
17 */
18 icon: IconSource;
19 /**
20 * Optional icon size.
21 */
22 size?: number;
23 /**
24 * Whether the button is disabled. A disabled button is greyed out and `onPress` is not called on touch.
25 */
26 disabled?: boolean;
27 /**
28 * Accessibility label for the button. This is read by the screen reader when the user taps the button.
29 */
30 accessibilityLabel?: string;
31 /**
32 * Function to execute on press.
33 */
34 onPress?: () => void;
35 /**
36 * @supported Available in v5.x with theme version 3
37 *
38 * Whether it's the leading button.
39 */
40 isLeading?: boolean;
41 style?: Animated.WithAnimatedValue<StyleProp<ViewStyle>>;
42 ref?: React.RefObject<View>;
43 /**
44 * @optional
45 */
46 theme?: ThemeProp;
47};
48/**
49 * A component used to display an action item in the appbar.
50 *
51 * ## Usage
52 * ```js
53 * import * as React from 'react';
54 * import { Appbar } from 'react-native-paper';
55 * import { Platform } from 'react-native';
56 *
57 * const MORE_ICON = Platform.OS === 'ios' ? 'dots-horizontal' : 'dots-vertical';
58 *
59 * const MyComponent = () => (
60 * <Appbar.Header>
61 * <Appbar.Content title="Title" subtitle={'Subtitle'} />
62 * <Appbar.Action icon="magnify" onPress={() => {}} />
63 * <Appbar.Action icon={MORE_ICON} onPress={() => {}} />
64 * </Appbar.Header>
65 * );
66 *
67 * export default MyComponent;
68 * ```
69 */
70declare const AppbarAction: import("../../utils/forwardRef").ForwardRefComponent<View, Props>;
71export default AppbarAction;
72export { AppbarAction };
73//# sourceMappingURL=AppbarAction.d.ts.map
\No newline at end of file