UNPKG

2.7 kBTypeScriptView Raw
1import * as React from 'react';
2import { Animated, StyleProp, ViewStyle } from 'react-native';
3import { Appbar } from './Appbar';
4import type { ThemeProp } from '../../types';
5export type Props = React.ComponentProps<typeof Appbar> & {
6 /**
7 * Whether the background color is a dark color. A dark header will render light text and vice-versa.
8 */
9 dark?: boolean;
10 /**
11 * Extra padding to add at the top of header to account for translucent status bar.
12 * This is automatically handled on iOS >= 11 including iPhone X using `SafeAreaView`.
13 * If you are using Expo, we assume translucent status bar and set a height for status bar automatically.
14 * Pass `0` or a custom value to disable the default behaviour, and customize the height.
15 */
16 statusBarHeight?: number;
17 /**
18 * Content of the header.
19 */
20 children: React.ReactNode;
21 /**
22 * @supported Available in v5.x with theme version 3
23 *
24 * Mode of the Appbar.
25 * - `small` - Appbar with default height (64).
26 * - `medium` - Appbar with medium height (112).
27 * - `large` - Appbar with large height (152).
28 * - `center-aligned` - Appbar with default height and center-aligned title.
29 */
30 mode?: 'small' | 'medium' | 'large' | 'center-aligned';
31 /**
32 * @supported Available in v5.x with theme version 3
33 * Whether Appbar background should have the elevation along with primary color pigment.
34 */
35 elevated?: boolean;
36 /**
37 * @optional
38 */
39 theme?: ThemeProp;
40 style?: Animated.WithAnimatedValue<StyleProp<ViewStyle>>;
41};
42/**
43 * A component to use as a header at the top of the screen.
44 * It can contain the screen title, controls such as navigation buttons, menu button etc.
45 *
46 * ## Usage
47 * ```js
48 * import * as React from 'react';
49 * import { Appbar } from 'react-native-paper';
50 *
51 * const MyComponent = () => {
52 * const _goBack = () => console.log('Went back');
53 *
54 * const _handleSearch = () => console.log('Searching');
55 *
56 * const _handleMore = () => console.log('Shown more');
57 *
58 * return (
59 * <Appbar.Header>
60 * <Appbar.BackAction onPress={_goBack} />
61 * <Appbar.Content title="Title" />
62 * <Appbar.Action icon="magnify" onPress={_handleSearch} />
63 * <Appbar.Action icon="dots-vertical" onPress={_handleMore} />
64 * </Appbar.Header>
65 * );
66 * };
67 *
68 * export default MyComponent;
69 * ```
70 */
71declare const AppbarHeader: {
72 ({ statusBarHeight, style, dark, mode, elevated, theme: themeOverrides, testID, ...rest }: Props): React.JSX.Element;
73 displayName: string;
74};
75export default AppbarHeader;
76export { AppbarHeader };
77//# sourceMappingURL=AppbarHeader.d.ts.map
\No newline at end of file