UNPKG

10.2 kBTypeScriptView Raw
1import * as React from 'react';
2import { Animated, View, ViewStyle, StyleProp, TextStyle } from 'react-native';
3import { IconSource } from './Icon';
4import Surface from './Surface';
5declare type Props = React.ComponentProps<typeof Surface> & {
6 /**
7 * Mode of the button. You can change the mode to adjust the styling to give it desired emphasis.
8 * - `text` - flat button without background or outline (low emphasis)
9 * - `outlined` - button with an outline (medium emphasis)
10 * - `contained` - button with a background color and elevation shadow (high emphasis)
11 */
12 mode?: 'text' | 'outlined' | 'contained';
13 /**
14 * Whether the color is a dark color. A dark button will render light text and vice-versa. Only applicable for `contained` mode.
15 */
16 dark?: boolean;
17 /**
18 * Use a compact look, useful for `text` buttons in a row.
19 */
20 compact?: boolean;
21 /**
22 * Custom text color for flat button, or background color for contained button.
23 */
24 color?: string;
25 /**
26 * Whether to show a loading indicator.
27 */
28 loading?: boolean;
29 /**
30 * Icon to display for the `Button`.
31 */
32 icon?: IconSource;
33 /**
34 * Whether the button is disabled. A disabled button is greyed out and `onPress` is not called on touch.
35 */
36 disabled?: boolean;
37 /**
38 * Label text of the button.
39 */
40 children: React.ReactNode;
41 /**
42 * Make the label text uppercased. Note that this won't work if you pass React elements as children.
43 */
44 uppercase?: boolean;
45 /**
46 * Accessibility label for the button. This is read by the screen reader when the user taps the button.
47 */
48 accessibilityLabel?: string;
49 /**
50 * Accessibility hint for the button. This is read by the screen reader when the user taps the button.
51 */
52 accessibilityHint?: string;
53 /**
54 * Function to execute on press.
55 */
56 onPress?: () => void;
57 /**
58 * Function to execute on long press.
59 */
60 onLongPress?: () => void;
61 /**
62 * Style of button's inner content.
63 * Use this prop to apply custom height and width and to set the icon on the right with `flexDirection: 'row-reverse'`.
64 */
65 contentStyle?: StyleProp<ViewStyle>;
66 style?: StyleProp<ViewStyle>;
67 /**
68 * Style for the button text.
69 */
70 labelStyle?: StyleProp<TextStyle>;
71 /**
72 * @optional
73 */
74 theme: ReactNativePaper.Theme;
75 /**
76 * testID to be used on tests.
77 */
78 testID?: string;
79};
80declare const _default: React.ComponentType<(Pick<Pick<import("react-native").ViewProps & React.RefAttributes<View> & {
81 children: React.ReactNode;
82 style?: false | import("react-native").RegisteredStyle<ViewStyle> | Animated.Value | Animated.AnimatedInterpolation | Animated.WithAnimatedObject<ViewStyle> | Animated.WithAnimatedArray<ViewStyle | import("react-native").Falsy | import("react-native").RegisteredStyle<ViewStyle> | import("react-native").RecursiveArray<ViewStyle | import("react-native").Falsy | import("react-native").RegisteredStyle<ViewStyle>> | readonly (ViewStyle | import("react-native").Falsy | import("react-native").RegisteredStyle<ViewStyle>)[]> | null | undefined;
83 theme: ReactNativePaper.Theme;
84}, keyof import("react-native").ViewProps | keyof React.RefAttributes<View>> & {
85 theme?: import("@callstack/react-theme-provider").$DeepPartial<ReactNativePaper.Theme> | undefined;
86} & {
87 /**
88 * Mode of the button. You can change the mode to adjust the styling to give it desired emphasis.
89 * - `text` - flat button without background or outline (low emphasis)
90 * - `outlined` - button with an outline (medium emphasis)
91 * - `contained` - button with a background color and elevation shadow (high emphasis)
92 */
93 mode?: "text" | "outlined" | "contained" | undefined;
94 /**
95 * Whether the color is a dark color. A dark button will render light text and vice-versa. Only applicable for `contained` mode.
96 */
97 dark?: boolean | undefined;
98 /**
99 * Use a compact look, useful for `text` buttons in a row.
100 */
101 compact?: boolean | undefined;
102 /**
103 * Custom text color for flat button, or background color for contained button.
104 */
105 color?: string | undefined;
106 /**
107 * Whether to show a loading indicator.
108 */
109 loading?: boolean | undefined;
110 /**
111 * Icon to display for the `Button`.
112 */
113 icon?: IconSource | undefined;
114 /**
115 * Whether the button is disabled. A disabled button is greyed out and `onPress` is not called on touch.
116 */
117 disabled?: boolean | undefined;
118 /**
119 * Label text of the button.
120 */
121 children: React.ReactNode;
122 /**
123 * Make the label text uppercased. Note that this won't work if you pass React elements as children.
124 */
125 uppercase?: boolean | undefined;
126 /**
127 * Accessibility label for the button. This is read by the screen reader when the user taps the button.
128 */
129 accessibilityLabel?: string | undefined;
130 /**
131 * Accessibility hint for the button. This is read by the screen reader when the user taps the button.
132 */
133 accessibilityHint?: string | undefined;
134 /**
135 * Function to execute on press.
136 */
137 onPress?: (() => void) | undefined;
138 /**
139 * Function to execute on long press.
140 */
141 onLongPress?: (() => void) | undefined;
142 /**
143 * Style of button's inner content.
144 * Use this prop to apply custom height and width and to set the icon on the right with `flexDirection: 'row-reverse'`.
145 */
146 contentStyle?: StyleProp<ViewStyle>;
147 style?: StyleProp<ViewStyle>;
148 /**
149 * Style for the button text.
150 */
151 labelStyle?: StyleProp<TextStyle>;
152 /**
153 * @optional
154 */
155 theme: ReactNativePaper.Theme;
156 /**
157 * testID to be used on tests.
158 */
159 testID?: string | undefined;
160}, "color" | "onPress" | "onLongPress" | "icon" | keyof import("react-native").ViewProps | "dark" | keyof React.RefAttributes<View> | "mode" | "uppercase" | "labelStyle" | "disabled" | "compact" | "loading" | "contentStyle"> | Pick<Pick<import("react-native").ViewProps & React.RefAttributes<View> & {
161 children: React.ReactNode;
162 style?: false | import("react-native").RegisteredStyle<ViewStyle> | Animated.Value | Animated.AnimatedInterpolation | Animated.WithAnimatedObject<ViewStyle> | Animated.WithAnimatedArray<ViewStyle | import("react-native").Falsy | import("react-native").RegisteredStyle<ViewStyle> | import("react-native").RecursiveArray<ViewStyle | import("react-native").Falsy | import("react-native").RegisteredStyle<ViewStyle>> | readonly (ViewStyle | import("react-native").Falsy | import("react-native").RegisteredStyle<ViewStyle>)[]> | null | undefined;
163 theme: ReactNativePaper.Theme;
164}, keyof import("react-native").ViewProps | keyof React.RefAttributes<View>> & {
165 theme?: import("@callstack/react-theme-provider").$DeepPartial<ReactNativePaper.Theme> | undefined;
166} & {
167 children?: React.ReactNode;
168} & {
169 /**
170 * Mode of the button. You can change the mode to adjust the styling to give it desired emphasis.
171 * - `text` - flat button without background or outline (low emphasis)
172 * - `outlined` - button with an outline (medium emphasis)
173 * - `contained` - button with a background color and elevation shadow (high emphasis)
174 */
175 mode?: "text" | "outlined" | "contained" | undefined;
176 /**
177 * Whether the color is a dark color. A dark button will render light text and vice-versa. Only applicable for `contained` mode.
178 */
179 dark?: boolean | undefined;
180 /**
181 * Use a compact look, useful for `text` buttons in a row.
182 */
183 compact?: boolean | undefined;
184 /**
185 * Custom text color for flat button, or background color for contained button.
186 */
187 color?: string | undefined;
188 /**
189 * Whether to show a loading indicator.
190 */
191 loading?: boolean | undefined;
192 /**
193 * Icon to display for the `Button`.
194 */
195 icon?: IconSource | undefined;
196 /**
197 * Whether the button is disabled. A disabled button is greyed out and `onPress` is not called on touch.
198 */
199 disabled?: boolean | undefined;
200 /**
201 * Label text of the button.
202 */
203 children: React.ReactNode;
204 /**
205 * Make the label text uppercased. Note that this won't work if you pass React elements as children.
206 */
207 uppercase?: boolean | undefined;
208 /**
209 * Accessibility label for the button. This is read by the screen reader when the user taps the button.
210 */
211 accessibilityLabel?: string | undefined;
212 /**
213 * Accessibility hint for the button. This is read by the screen reader when the user taps the button.
214 */
215 accessibilityHint?: string | undefined;
216 /**
217 * Function to execute on press.
218 */
219 onPress?: (() => void) | undefined;
220 /**
221 * Function to execute on long press.
222 */
223 onLongPress?: (() => void) | undefined;
224 /**
225 * Style of button's inner content.
226 * Use this prop to apply custom height and width and to set the icon on the right with `flexDirection: 'row-reverse'`.
227 */
228 contentStyle?: StyleProp<ViewStyle>;
229 style?: StyleProp<ViewStyle>;
230 /**
231 * Style for the button text.
232 */
233 labelStyle?: StyleProp<TextStyle>;
234 /**
235 * @optional
236 */
237 theme: ReactNativePaper.Theme;
238 /**
239 * testID to be used on tests.
240 */
241 testID?: string | undefined;
242}, "color" | "onPress" | "onLongPress" | "icon" | keyof import("react-native").ViewProps | "dark" | keyof React.RefAttributes<View> | "mode" | "uppercase" | "labelStyle" | "disabled" | "compact" | "loading" | "contentStyle">) & {
243 theme?: import("@callstack/react-theme-provider").$DeepPartial<ReactNativePaper.Theme> | undefined;
244}> & import("@callstack/react-theme-provider/typings/hoist-non-react-statics").NonReactStatics<React.ComponentType<Props> & (({ disabled, compact, mode, dark, loading, icon, color: buttonColor, children, uppercase, accessibilityLabel, accessibilityHint, onPress, onLongPress, style, theme, contentStyle, labelStyle, testID, accessible, ...rest }: Props) => JSX.Element), {}>;
245export default _default;
246
\No newline at end of file