Skip to main content
Version: 1.0.0

Switch

Switch components render a pre-styled switch that can easily be re-style by using props.

Example banner Example banner

Implementation code

import { Switch } from 'rn-nativeflow';

const Component = () => {
return (
<Switch
checked={true}
size={0.8}
color='#000000'
onChange={(e) => console.log(e)}
/>
);
}
export default Component;

Props

PropTypeDefaultDescription
checkedbooleantruevalue of the switch, true means on and false means off
colorstringIt sets the color of the switch
disabledbooleanfalseDisable toggling the switch
sizenumber0.8Sets the size of the switch
activeTrackColorstringIt sets the track color of switch when checked = true
inactiveTrackColorstringIt sets the track color of switch when checked = false
onChangefunctionit fired when the value is changed