githuboftigran / rn-range-slider

A native slider with range
MIT License
245 stars 137 forks source link

Custom label #118

Closed raajnadar-cb closed 3 years ago

raajnadar-cb commented 3 years ago

I want to use custom mapping instead of regular mapping something like

+1, 0, 1, 2, 3, 4, ..... 9, 10+

How can we do that? Didn't find any way to add custom labels.

githuboftigran commented 3 years ago

@raajnadar-cb , please check out renderLabel prop, it's a function which receives value from parameters and returns a react node. You can render any custom node based on value parameter.

raajnadar-cb commented 3 years ago

Can you add a simple example of how to use it? I also want it to return the same custom value so that I can store it in a local state.

raajnadar-cb commented 3 years ago

My requirement is something like this

slider

The value above the slider is stored in the local state.