UNPKG

2.12 kBTypeScriptView Raw
1import * as React from 'react';
2import { StyleProp, ViewStyle, GestureResponderEvent } from 'react-native';
3import type { IconSource } from '../Icon';
4declare type Props = {
5 /**
6 * Icon to display for the `ToggleButton`.
7 */
8 icon: IconSource;
9 /**
10 * Size of the icon.
11 */
12 size?: number;
13 /**
14 * Custom text color for button.
15 */
16 color?: string;
17 /**
18 * Whether the button is disabled.
19 */
20 disabled?: boolean;
21 /**
22 * Accessibility label for the `ToggleButton`. This is read by the screen reader when the user taps the button.
23 */
24 accessibilityLabel?: string;
25 /**
26 * Function to execute on press.
27 */
28 onPress?: (value?: GestureResponderEvent | string) => void;
29 /**
30 * Value of button.
31 */
32 value?: string;
33 /**
34 * Status of button.
35 */
36 status?: 'checked' | 'unchecked';
37 style?: StyleProp<ViewStyle>;
38 /**
39 * @optional
40 */
41 theme: ReactNativePaper.Theme;
42};
43declare const _default: React.ComponentType<Pick<Props, "style" | "color" | "size" | "onPress" | "accessibilityLabel" | "icon" | "value" | "disabled" | "status"> & {
44 theme?: import("@callstack/react-theme-provider").$DeepPartial<ReactNativePaper.Theme> | undefined;
45}> & import("@callstack/react-theme-provider/typings/hoist-non-react-statics").NonReactStatics<React.ComponentType<Props> & (({ icon, size, theme, accessibilityLabel, disabled, style, value, status, onPress, ...rest }: Props) => JSX.Element), {}>;
46export default _default;
47declare const ToggleButtonWithTheme: React.ComponentType<Pick<Props, "style" | "color" | "size" | "onPress" | "accessibilityLabel" | "icon" | "value" | "disabled" | "status"> & {
48 theme?: import("@callstack/react-theme-provider").$DeepPartial<ReactNativePaper.Theme> | undefined;
49}> & import("@callstack/react-theme-provider/typings/hoist-non-react-statics").NonReactStatics<React.ComponentType<Props> & (({ icon, size, theme, accessibilityLabel, disabled, style, value, status, onPress, ...rest }: Props) => JSX.Element), {}>;
50export { ToggleButtonWithTheme as ToggleButton };
51
\No newline at end of file