Custom step size averaged out across the slider? #359
-
Hey man, love your slider it's gorgeous. I have a range from 0 - 400. I need five steps in that range - 1.5, 2, 6, 10, and 100. The problem is that they're all mostly clustered down at the end of the slider, because there are so many low numbers. Is there a way to add custom steps wherever I like along the slider, so instead of looking like this: 0----------100---------200---------300---------400 It would look like: 0----1.5------2--------6-------10------100-----400 Is that doable? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
Have a look at this codepen. <input type="range" min="0" max="6" step="1" value="0"> const valueMapping = [0, 1.5, 2, 6, 10, 100, 400] |
Beta Was this translation helpful? Give feedback.
Have a look at this codepen.
It describes an approach of value mapping. In your case this would look something like this: