GithubHelp home page GithubHelp logo

Comments (12)

luisrudge avatar luisrudge commented on May 22, 2024 2

That's a nice idea! I'll give it a shot during the weekend. Thanks for the tip

from react-range.

tajo avatar tajo commented on May 22, 2024 1

@tajo but I assume the lib already knows where the steps are, that's how you can 'stick' the thumb to the step correct position. Consumers of the library would have to add code to calculate where the steps should be based on width, size etc..

Yea, the renderTrack could pass the positions through a prop. And there could be some additional getTrackBackgroundStep utility function using those steps to generate that background.

Do you want to give it a try?

from react-range.

tajo avatar tajo commented on May 22, 2024

Could you describe it more?

from react-range.

luisrudge avatar luisrudge commented on May 22, 2024

When I use the step prop, I'd like to be able to customize how the step looks like (probably with a renderStep method to keep the api consistent.

Example from material-ui:

custom steps

What I actually want to achieve:
image

from react-range.

tajo avatar tajo commented on May 22, 2024

There is no "out of the box" support but you have a complete access to the "track element". It comes with the getTrackBackground utility that generates a linear gradient to set different background "before" and "after". You could write your own function to also add steps. Or introduce steps as a second background / layer. Really up to you at this point.

from react-range.

luisrudge avatar luisrudge commented on May 22, 2024

@tajo but I assume the lib already knows where the steps are, that's how you can 'stick' the thumb to the step correct position. Consumers of the library would have to add code to calculate where the steps should be based on width, size etc..

from react-range.

hungle1220 avatar hungle1220 commented on May 22, 2024

@tajo but I assume the lib already knows where the steps are, that's how you can 'stick' the thumb to the step correct position. Consumers of the library would have to add code to calculate where the steps should be based on width, size etc..

Yea, the renderTrack could pass the positions through a prop. And there could be some additional getTrackBackgroundStep utility function using those steps to generate that background.

Do you want to give it a try?

@luisrudge what about result bro :D

from react-range.

giacomoalonzi avatar giacomoalonzi commented on May 22, 2024

this feature has been implemented? I'm trying to use this library to achieve the same result, but as you can see I'm not able to align dots with slider movements.
Screenshot 2020-03-30 at 17 54 50

Thanks

from react-range.

tajo avatar tajo commented on May 22, 2024

this feature has been implemented

It's been not.

from react-range.

jameschetwood avatar jameschetwood commented on May 22, 2024

You can also do this by setting one of the colors in getTrackBackground to "transparent", and by having the linear gradient in a containing div.

from react-range.

ianninirojas avatar ianninirojas commented on May 22, 2024

Hi, was anyone able to style the step break?

from react-range.

tajo avatar tajo commented on May 22, 2024

I'm working on this now.

from react-range.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.