UNPKG

2.38 kBTypeScriptView Raw
1import * as React from 'react';
2import { GestureResponderEvent, StyleProp, TextStyle, View, ViewStyle } from 'react-native';
3import type { $RemoveChildren, ThemeProp } from '../../types';
4import { TextRef } from '../Typography/Text';
5type TitleString = {
6 title: string;
7 titleStyle?: StyleProp<TextStyle>;
8};
9type TitleElement = {
10 title: React.ReactNode;
11 titleStyle?: never;
12};
13export type Props = $RemoveChildren<typeof View> & {
14 /**
15 * Text or component for the title.
16 */
17 title: React.ReactNode;
18 /**
19 * Style for the title, if `title` is a string.
20 */
21 titleStyle?: StyleProp<TextStyle>;
22 /**
23 * Reference for the title.
24 */
25 titleRef?: React.RefObject<TextRef>;
26 /**
27 * @deprecated Deprecated in v5.x
28 * Text for the subtitle.
29 */
30 subtitle?: React.ReactNode;
31 /**
32 * @deprecated Deprecated in v5.x
33 * Style for the subtitle.
34 */
35 subtitleStyle?: StyleProp<TextStyle>;
36 /**
37 * Function to execute on press.
38 */
39 onPress?: (e: GestureResponderEvent) => void;
40 /**
41 * If true, disable all interactions for this component.
42 */
43 disabled?: boolean;
44 /**
45 * Custom color for the text.
46 */
47 color?: string;
48 /**
49 * Specifies the largest possible scale a title font can reach.
50 */
51 titleMaxFontSizeMultiplier?: number;
52 /**
53 * @internal
54 */
55 mode?: 'small' | 'medium' | 'large' | 'center-aligned';
56 style?: StyleProp<ViewStyle>;
57 /**
58 * @optional
59 */
60 theme?: ThemeProp;
61 /**
62 * testID to be used on tests.
63 */
64 testID?: string;
65} & (TitleString | TitleElement);
66/**
67 * A component used to display a title and optional subtitle in an appbar.
68 *
69 * ## Usage
70 * ```js
71 * import * as React from 'react';
72 * import { Appbar } from 'react-native-paper';
73 *
74 * const MyComponent = () => (
75 * <Appbar.Header>
76 * <Appbar.Content title="Title" />
77 * </Appbar.Header>
78 * );
79 *
80 * export default MyComponent;
81 * ```
82 */
83declare const AppbarContent: {
84 ({ color: titleColor, subtitle, subtitleStyle, onPress, disabled, style, titleRef, titleStyle, title, titleMaxFontSizeMultiplier, mode, theme: themeOverrides, testID, ...rest }: Props): React.JSX.Element;
85 displayName: string;
86};
87export default AppbarContent;
88export { AppbarContent };
89//# sourceMappingURL=AppbarContent.d.ts.map
\No newline at end of file