UNPKG

1.52 kBTypeScriptView Raw
1import * as React from 'react';
2import { GestureResponderEvent } from 'react-native';
3import type { ThemeProp } from '../../types';
4export declare type Props = {
5 /**
6 * Status of checkbox.
7 */
8 status: 'checked' | 'unchecked' | 'indeterminate';
9 /**
10 * Whether checkbox is disabled.
11 */
12 disabled?: boolean;
13 /**
14 * Function to execute on press.
15 */
16 onPress?: (e: GestureResponderEvent) => void;
17 /**
18 * Custom color for unchecked checkbox.
19 */
20 uncheckedColor?: string;
21 /**
22 * Custom color for checkbox.
23 */
24 color?: string;
25 /**
26 * @optional
27 */
28 theme?: ThemeProp;
29 /**
30 * testID to be used on tests.
31 */
32 testID?: string;
33};
34/**
35 * Checkboxes allow the selection of multiple options from a set.
36 *
37 * ## Usage
38 * ```js
39 * import * as React from 'react';
40 * import { Checkbox } from 'react-native-paper';
41 *
42 * const MyComponent = () => {
43 * const [checked, setChecked] = React.useState(false);
44 *
45 * return (
46 * <Checkbox
47 * status={checked ? 'checked' : 'unchecked'}
48 * onPress={() => {
49 * setChecked(!checked);
50 * }}
51 * />
52 * );
53 * };
54 *
55 * export default MyComponent;
56 * ```
57 */
58declare const Checkbox: ({ theme: themeOverrides, ...props }: Props) => React.JSX.Element;
59export default Checkbox;
60declare const CheckboxWithTheme: ({ theme: themeOverrides, ...props }: Props) => React.JSX.Element;
61export { CheckboxWithTheme as Checkbox };
62//# sourceMappingURL=Checkbox.d.ts.map
\No newline at end of file