UNPKG

3.95 kBTypeScriptView Raw
1import * as React from 'react';
2import { StyleProp, TextStyle, View, ViewStyle } from 'react-native';
3import type { MD3TypescaleKey, ThemeProp } from '../../types';
4export type Props = React.ComponentPropsWithRef<typeof View> & {
5 /**
6 * Text for the title. Note that this will only accept a string or `<Text>`-based node.
7 */
8 title: React.ReactNode;
9 /**
10 * Style for the title.
11 */
12 titleStyle?: StyleProp<TextStyle>;
13 /**
14 * Number of lines for the title.
15 */
16 titleNumberOfLines?: number;
17 /**
18 * @supported Available in v5.x with theme version 3
19 *
20 * Title text variant defines appropriate text styles for type role and its size.
21 * Available variants:
22 *
23 * Display: `displayLarge`, `displayMedium`, `displaySmall`
24 *
25 * Headline: `headlineLarge`, `headlineMedium`, `headlineSmall`
26 *
27 * Title: `titleLarge`, `titleMedium`, `titleSmall`
28 *
29 * Label: `labelLarge`, `labelMedium`, `labelSmall`
30 *
31 * Body: `bodyLarge`, `bodyMedium`, `bodySmall`
32 */
33 titleVariant?: keyof typeof MD3TypescaleKey;
34 /**
35 * Text for the subtitle. Note that this will only accept a string or `<Text>`-based node.
36 */
37 subtitle?: React.ReactNode;
38 /**
39 * Style for the subtitle.
40 */
41 subtitleStyle?: StyleProp<TextStyle>;
42 /**
43 * Number of lines for the subtitle.
44 */
45 subtitleNumberOfLines?: number;
46 /**
47 * @supported Available in v5.x with theme version 3
48 *
49 * Subtitle text variant defines appropriate text styles for type role and its size.
50 * Available variants:
51 *
52 * Display: `displayLarge`, `displayMedium`, `displaySmall`
53 *
54 * Headline: `headlineLarge`, `headlineMedium`, `headlineSmall`
55 *
56 * Title: `titleLarge`, `titleMedium`, `titleSmall`
57 *
58 * Label: `labelLarge`, `labelMedium`, `labelSmall`
59 *
60 * Body: `bodyLarge`, `bodyMedium`, `bodySmall`
61 */
62 subtitleVariant?: keyof typeof MD3TypescaleKey;
63 /**
64 * Callback which returns a React element to display on the left side.
65 */
66 left?: (props: {
67 size: number;
68 }) => React.ReactNode;
69 /**
70 * Style for the left element wrapper.
71 */
72 leftStyle?: StyleProp<ViewStyle>;
73 /**
74 * Callback which returns a React element to display on the right side.
75 */
76 right?: (props: {
77 size: number;
78 }) => React.ReactNode;
79 /**
80 * Style for the right element wrapper.
81 */
82 rightStyle?: StyleProp<ViewStyle>;
83 /**
84 * @internal
85 */
86 index?: number;
87 /**
88 * @internal
89 */
90 total?: number;
91 /**
92 * Specifies the largest possible scale a title font can reach.
93 */
94 titleMaxFontSizeMultiplier?: number;
95 /**
96 * Specifies the largest possible scale a subtitle font can reach.
97 */
98 subtitleMaxFontSizeMultiplier?: number;
99 style?: StyleProp<ViewStyle>;
100 /**
101 * @optional
102 */
103 theme?: ThemeProp;
104};
105/**
106 * A component to show a title, subtitle and an avatar inside a Card.
107 *
108 * ## Usage
109 * ```js
110 * import * as React from 'react';
111 * import { Avatar, Card, IconButton } from 'react-native-paper';
112 *
113 * const MyComponent = () => (
114 * <Card.Title
115 * title="Card Title"
116 * subtitle="Card Subtitle"
117 * left={(props) => <Avatar.Icon {...props} icon="folder" />}
118 * right={(props) => <IconButton {...props} icon="dots-vertical" onPress={() => {}} />}
119 * />
120 * );
121 *
122 * export default MyComponent;
123 * ```
124 */
125declare const CardTitle: {
126 ({ title, titleStyle, titleNumberOfLines, titleVariant, titleMaxFontSizeMultiplier, subtitle, subtitleStyle, subtitleNumberOfLines, subtitleVariant, subtitleMaxFontSizeMultiplier, left, leftStyle, right, rightStyle, style, theme: themeOverrides, }: Props): React.JSX.Element;
127 displayName: string;
128};
129export default CardTitle;
130export { CardTitle };
131//# sourceMappingURL=CardTitle.d.ts.map
\No newline at end of file