Skip to content

make more customizable#44

Open
jedwards1211 wants to merge 2 commits intodavidchin:masterfrom
jedwards1211:more-customizable
Open

make more customizable#44
jedwards1211 wants to merge 2 commits intodavidchin:masterfrom
jedwards1211:more-customizable

Conversation

@jedwards1211
Copy link
Copy Markdown

I wanted to do some more detailed customization than is possible with classNames and formatLabel. This PR allows you to pass in your own Track, Slider, and Label components to InputRange as props. It also exports the default components for those so that you can wrap them if necessary. It also allows you to pass in extra children to InputRange and Slider.

@chosenvictim
Copy link
Copy Markdown

chosenvictim commented Jan 24, 2017

It would be good if there is any functionality for showing a Scale with the slider. So that its easily understandable how much you are dragging each time

@oyeanuj
Copy link
Copy Markdown
Contributor

oyeanuj commented Mar 7, 2017

Hi @davidchin! Wondering if you were planning to merge this PR? Amongst other things, it would also resolve #35 and make it easier to achieve #64 (tooltip issue I just raised).

@guncha
Copy link
Copy Markdown

guncha commented Dec 27, 2017

This is exactly what I wanted to do. Another good addition would be to export the default Label, Slider and Track components so the InputRange parent components can use wrappers that manipulate the props in some way, but defer to the default behavior.

Nvm, the fork already does this! I rebased it on top of the current master and added the Typescript types, if anyone else needs it: https://github.com/Pathgather/react-input-range/tree/more-customizable

@davidchin, if you're interested, I could add some specs and perhaps we can merge it.

@oyeanuj
Copy link
Copy Markdown
Contributor

oyeanuj commented Jan 8, 2018

@davidchin Thoughts on merging this?

@davidchin
Copy link
Copy Markdown
Owner

Hey @oyeanuj and @jedwards1211, thanks for bringing this to my attention. Sorry I couldn't respond to you earlier as Github notifications tend to get lost in my inbox. Anyway, I think it's a good idea - so you can pass in your own definition of Track, Slider and Label. I suggest we should document the interfaces for these components (i.e.: the required props and callbacks etc...), so that people know exactly what they need to implement. Also, we (as maintainers) need to make sure we don't change them inadvertently as they will become a part of the public interface of this library.

@oyeanuj
Copy link
Copy Markdown
Contributor

oyeanuj commented Mar 6, 2018

@jedwards1211 @guncha Can your forks be merged (or do they need to be updated) since @davidchin is in favor of this idea?

@guncha
Copy link
Copy Markdown

guncha commented Mar 6, 2018

@oyeanuj I'll just bring up my branch with master and open a new PR with some extra documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants