Checkbox
Checkboxes allow the selection of multiple options from a set.
How to use
import React from "react";
import {Checkbox} from '@gyri/native-ui-components';
const MyComponent = () => {
const [checked, setChecked] = React.useState(false);
return (
<Checkbox
status={checked ? 'checked':'unchecked'}
onPress={()=> {
setChecked(!checked)
}}
/>
);
};
export default MyComponent;
Props
| # | Name | Data type | Default value | Values | Description |
|---|---|---|---|---|---|
| 1 | status | string | console.log | Status of checkbox | |
| 2 | onPress | function | " | Function to execute on press. | |
| 3 | color | string | " | Custom color for checkbox. | |
| 4 | uncheckedColor | string | Custom color for unchecked checkbox. | ||
| 5 | disabled | boolean | Whether checkbox is disabled. |
For more details https://callstack.github.io/react-native-paper/docs/components/Checkbox