Checkbox
Checkbox component for toggling boolean value related to some context
(code example)
This component extends TouchableOpacity props.
This component support margin, background modifiers.
Usageβ
function Example(props) { const [value, setValue] = useState(false); return ( <div> <Checkbox value={value} onValueChange={setValue}/> </div> ); }
APIβ
borderRadiusβ
The Checkbox border radius
number
colorβ
The Checkbox color
string
containerStyleβ
Custom styling for the checkbox and label container
ViewStyle
disabledβ
Whether the checkbox should be disabled
boolean
iconColorβ
The selected icon color
string
labelβ
Add a label to the Checkbox
string
labelPropsβ
Props to pass on to the label component
TextProps
labelStyleβ
Pass to style the label
TextStyle
onChangeValidityβ
Callback for when field validity has changed
(isValid: boolean) => void
onValueChangeβ
Callback function for value change event
(value) => void
outlineβ
Alternative Checkbox outline style
boolean
requiredβ
Whether the checkbox is required
boolean
selectedIconβ
The icon asset to use for the selected indication
ImageRequireSource
sizeβ
The Checkbox size, affect both width and height
number
styleβ
Custom styling for the Checkbox
ViewStyle
valueβ
The Checkbox value. If true the switch will be turned on. Default value is false
boolean