Build a Custom Single-Thumb Range Slider Component
Sharechat's content discovery heavily relies on robust filtering options to help users find relevant posts. A common requirement for numerical filters, such as age ranges or video durations, is an intuitive range slider. Your task is to implement a basic, custom single-thumb range slider component from scratch in React.
RangeSlider React component that accepts min, max, step, and an initial value as props.min, max, and step constraints.onChange prop that is called with the new value when the slider's value changes.RangeSlider component renders correctly with initial min, max, step, and value.min or max bounds.onChange callback is triggered with the correct numerical value when the slider's value changes.step property, meaning the value only changes in increments of step.Constraints
min, max, step props will always be positive integers, with min < max and step > 0.value will always be between min and max (inclusive).MouseEvent for drag, getBoundingClientRect()) without relying on third-party slider libraries.mousedown, mousemove, mouseup).min, max, and step.Loading editor...