docs/react-wiki-archive/RangeSlider.md
We are proposing to do some changes to the props of the existing Slider to expand its functionality. With the new option users will be able to use it as a RangeSlider.
The Azure Portal team is gradually embracing React for the development of Azure Portal, however there is no React-based UI library internally for Portal. So we decided to use FluentUI for basic UI needs. Whenever we cannot find a good match for an old portal control from existing FluentUI components, we would like to collaborate and contribute back to FluentUI to fill the gap.
There is a control called RangeSlider that is used by a couple of Azure extension teams. (https://ms.portal.azure.com/?Microsoft_Azure_Playground=true#blade/Microsoft_Azure_Playground/ControlsIndexBlade/RangeSlider_createSimpleRangeSlider_Playground), which is not supported by current FluentUI. The current Slider component from FluentUI has only one thumb that allows the users to drag and change value. Since this kind of control is generic and no logic is specific to Portal, we propose to add features to the existing FluentUI slider, to make it capable of becoming a RangeSlider. So that the portal teams using RangeSlider will not be blocked when converting to ReactView, and FluentUI Slider component could provide more features.
Current RangeSlider control in Azure Portal is more complex than the existing fluent Slider component, in that it has markers below the slider bar and textboxes on both sides that allows user input. To make things simple, the proposal only aims at making the minimum function working. We will focus on adding a thumb to make it a RangeSlider, and not talk about the other functionalities.
ranged prop to existing Slidertrue, there will be two thumbs on the slider.showValue prop is also set to true, another value label will show up on the other side of the slider (opposite side of the existing value label) to show the value of the lower value thumb.originFromZero prop is set to true, the lower value cannot be set larger than 0, and the upper value cannot be set lower than 0lowerValue, defaultLowerValue props to existing Slidervalue and defaultValue props, these two props are mutually exclusive and they represents the value/default value for the lower bound of the slider.ranged effect is falseranged is set to true, then the lower value of the rangeSlider will default to min prop, or 0 if min is also not providedonChange and onChanged props to reflect rangeranged is set to false, no changes for the existing APIranged is set to true, then the function signature of these two would be come (value: [number, number]) => void, (event: MouseEvent | TouchEvent | KeyboardEvent, value: [number, number]) => void. The two numbers in the tuple represents the lower value and upper value of the RangeSliderI have done some work as a POC for the RangeSlider. Here is the branch: https://github.com/microsoft/fluentui/compare/master...rockcs1992:shiche/range-slider?expand=1
And here is screenshot on how it looks like https://mystuff.bublup.com/ui/landing_page?item_id=001-i-5f2f1a94-4182-4980-9eaf-69101a71519c