Home > Software engineering >  How would I make a Custom Switch and Toggle Like this In react Native
How would I make a Custom Switch and Toggle Like this In react Native

Time:01-16

I am Trying to make a custom switch in react native expo but all the NPM's components don't seem to work, how would i come about creating a custom switch with animations and a custom toggle like the ones show in the image with react native expo?

What I am trying to make

CodePudding user response:

To achieve your first switch example you can look at react-native-switch and tweak it slightly to take a height and width (instead of circle size). I have a working example of this here.

For your second example a simple TouchableOpacity with toggle icon should suffice. You can get a little more elborate and add a color animation if you wanted.

  •  Tags:  
  • Related