UNPKG

2.46 kBTypeScriptView Raw
1import * as React from 'react';
2import { StyleProp, TextStyle, ViewStyle } from 'react-native';
3declare type Props = {
4 /**
5 * Status of checkbox.
6 */
7 status: 'checked' | 'unchecked' | 'indeterminate';
8 /**
9 * Whether checkbox is disabled.
10 */
11 disabled?: boolean;
12 /**
13 * Label to be displayed on the item.
14 */
15 label: string;
16 /**
17 * Function to execute on press.
18 */
19 onPress?: () => void;
20 /**
21 * Custom color for unchecked checkbox.
22 */
23 uncheckedColor?: string;
24 /**
25 * Custom color for checkbox.
26 */
27 color?: string;
28 /**
29 * Additional styles for container View.
30 */
31 style?: StyleProp<ViewStyle>;
32 /**
33 * Style that is passed to Label element.
34 */
35 labelStyle?: StyleProp<TextStyle>;
36 /**
37 * @optional
38 */
39 theme: ReactNativePaper.Theme;
40 /**
41 * testID to be used on tests.
42 */
43 testID?: string;
44 /**
45 * Checkbox control position.
46 */
47 position?: 'leading' | 'trailing';
48 /**
49 * Whether `<Checkbox.Android />` or `<Checkbox.IOS />` should be used.
50 * Left undefined `<Checkbox />` will be used.
51 */
52 mode?: 'android' | 'ios';
53};
54declare const _default: React.ComponentType<Pick<Props, "label" | "style" | "color" | "onPress" | "testID" | "position" | "mode" | "labelStyle" | "disabled" | "status" | "uncheckedColor"> & {
55 theme?: import("@callstack/react-theme-provider").$DeepPartial<ReactNativePaper.Theme> | undefined;
56}> & import("@callstack/react-theme-provider/typings/hoist-non-react-statics").NonReactStatics<React.ComponentType<Props> & {
57 ({ style, status, label, onPress, labelStyle, theme, testID, mode, position, disabled, ...props }: Props): JSX.Element;
58 displayName: string;
59}, {}>;
60export default _default;
61declare const CheckboxItemWithTheme: React.ComponentType<Pick<Props, "label" | "style" | "color" | "onPress" | "testID" | "position" | "mode" | "labelStyle" | "disabled" | "status" | "uncheckedColor"> & {
62 theme?: import("@callstack/react-theme-provider").$DeepPartial<ReactNativePaper.Theme> | undefined;
63}> & import("@callstack/react-theme-provider/typings/hoist-non-react-statics").NonReactStatics<React.ComponentType<Props> & {
64 ({ style, status, label, onPress, labelStyle, theme, testID, mode, position, disabled, ...props }: Props): JSX.Element;
65 displayName: string;
66}, {}>;
67export { CheckboxItemWithTheme as CheckboxItem };