Skip to content
Advertisement

Display value of slider with respect to slider thumb react native

I want to move the label with respect to slider thumb just like this one: enter image description here

Right now my slider is like this:

enter image description here

I want to display the label shown as 30 km with respect to the slider thumb such that as the slider moves, the label should move accordingly.

I am using Native React Slider component.

this is my code:

JavaScript

Advertisement

Answer

Solution to your problem:

JavaScript

Styles:

JavaScript

Output:

https://i.stack.imgur.com/telTT.jpg

Working Snippet: https://snack.expo.io/Syrt3Bs7z

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement