Skip to main content

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

#NameData typeDefault valueValuesDescription
1statusstringconsole.logStatus of checkbox
2onPressfunction"Function to execute on press.
3colorstring"Custom color for checkbox.
4uncheckedColorstringCustom color for unchecked checkbox.
5disabledbooleanWhether checkbox is disabled.

For more details https://callstack.github.io/react-native-paper/docs/components/Checkbox