Switch
Switch is a visual toggle between two components.
import { Switch } from "cherag-ui"'
Usage
Example 1
     <Switch
        size="sm"
        offTrackColor={COLORS.red}
        onTrackColor={COLORS.green}
        isSwitchCheck={isSwitchCheck}
        setIsSwitchCheck={setIsSwitchCheck}
        thumbColor={COLORS.lightGray7}
      />
Example 2
     <Switch
        size="md"
        offTrackColor={COLORS.red}
        onTrackColor={COLORS.green}
        isSwitchCheck={isSwitchCheck}
        setIsSwitchCheck={setIsSwitchCheck}
        thumbColor={COLORS.lightGray7}
      />
Props
Switch Propertics
Name
Type
Description
style
StyleProp<ViewStyle>
Style of Switch.
size
string
sm | md | lg
disabled
boolean
Disable switch button.
isSwitchCheck
boolean
Save switch active status.
setIsSwitchCheck
(event: GestureResponderEvent) => void
Change and save function for switch active status .
thumbColor
string
Thumb color of switch.
onTrackColor
string
Active track color.
offTrackColor
string
Deactive track color.