Input.Checkbox
Import
import { Input } from "@dhua5922/react-native-kit";
Examples
Live Editor
function Example() { const [checked1, setChecked1] = useState(false); const [checked2, setChecked2] = useState(false); return ( <> <Input.Checkbox checked={checked1} onChange={(checked) => setChecked1(checked)} style={{ marginBottom: 12 }} > Checkbox 1 </Input.Checkbox> <Input.Checkbox checked={checked2} onChange={(checked) => setChecked2(checked)} disabled > Disabled checkbox </Input.Checkbox> </> ); }
Result
Loading...
Props
note
Include all props from Pressable
| Name | Type | Default | Description |
|---|---|---|---|
checked | boolean | false | Show checkmark if checked; otherwise, hide checkmark. |
onChange | (checked: boolean) => void | Callback fired when checkbox has been pressed. | |
size | number | 24 | Width and height of checkbox. |
Checkmark | React.ReactNode | Custom checkmark. | |
color | string | #2089dc | Color of checkmark. |