How to change the switch component's size in React Native?
You can resize the switch by using transform property from styling,
<Switch value={true}
style={{ transform: [{ scaleX: .8 }, { scaleY: .8 }] }}
onValueChange={(value) => {}} />
also for best result determine scaling values based on screen dimension.
To expand on what was already said, this is how you can handle screen sizes:
import { moderateScale } from 'react-native-size-matters';
...
<Switch
style={{ transform: [{ scaleX: moderateScale(1, 0.2) }, { scaleY:
moderateScale(1, 0.2) }] }} />
If the size is a UI concern only you can add a negative margin
For example on my case i would just reduce the height (a little) to keep things aligned:
<Switch style={{marginVertical: -8}} />