Switch
Switch component for toggling boolean value related to some context
(code example)
#
Usage<Switch value={false} onValueChange={() => console.log('value changed')}/>
#
API#
disabledWhether the switch should be disabled
boolean
#
disabledColorThe Switch background color when it's disabled
string
#
heightThe Switch height
number
#
idComponent id
string
#
offColorThe Switch background color when it's turned off
string
#
onColorThe Switch background color when it's turned on
string
#
onValueChangeInvoked with the new value when the value changes
(value: boolean) => void
#
styleCustom style
ViewStyle
#
testIDComponent test id
string
#
thumbColorThe Switch's thumb color
string
#
thumbSizeThe Switch's thumb size (width & height)
number
#
thumbStyleThe Switch's thumb style
ViewStyle
#
valueThe value of the switch. If true the switch will be turned on. Default value is false
boolean
#
widthThe Switch width
number