NativeBase icon indicating copy to clipboard operation
NativeBase copied to clipboard

Slider component supports range select

Open hohoaisan opened this issue 3 years ago • 2 comments

Description

Please add support for ranged-slider for selecting between two values

Problem Statement

Currently Slider component only support one-sided and only one value per Slider, there're use cases that needs ranged slider like selecting between prices range, amount range,.. but it doesn't support.

Proposed Solution or API

Add option isRange: boolean to Slider component and accepts defaultValue/value as an array

const Example = () => {
  return
    <Box alignItems="center" w="100%">
      <Slider isRanged={true} w="3/4" maxW="300" low={0} high={70} minValue={0} maxValue={100} accessibilityLabel="hello world" step={10}>
        <Slider.Thumb />
        <Slider.Track>
          <Slider.FilledTrack />
        </Slider.Track>
        <Slider.Thumb />
      </Slider>
    </Box>;
};

Alternatives

No response

Additional Information

No response

hohoaisan avatar Jul 21 '22 08:07 hohoaisan

Hi @hohoaisan, Can you provide a wireframe for this feature?

Viraj-10 avatar Jul 21 '22 08:07 Viraj-10

@Viraj-10 It would probably look like this: https://mui.com/material-ui/react-slider/#range-slider

roshangm avatar Aug 04 '22 11:08 roshangm