Last active
July 25, 2022 15:05
-
-
Save angjez/3109c1ce9b821a4bab46ab9f9744b89a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ToggleCircle | |
style={{ x }} // this will change the coordinate of the wrapper as you drag | |
drag="x" // drag direction | |
dragConstraints={{ left: -100, right: 100 }} // depends how long of a drag you want to allow | |
dragSnapToOrigin={true} // will bring the wrapper back to the center upon release | |
dragElastic={0.1} // adds a more natural feel | |
whileDrag={{ scale: 1.3 }}> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment