Interactive Dual-Handle Range Slider
Inmobi's ad platform relies heavily on user-friendly interfaces for configuring campaign parameters and analyzing performance data. A common requirement is to allow users to filter or select data within a specific numerical range, such as ad bid amounts, impression counts, or date ranges. A well-implemented range slider enhances the user experience by providing an intuitive visual control for these selections, improving data exploration and configuration efficiency.
Your task is to build a reusable RangeSlider React component that allows users to select a numerical range using two draggable handles.
onChange prop that gets called whenever the selected range changes, providing the new [min, max] values.min and max selected values should be displayed as text, updating in real-time as handles are moved.tab key). left and right arrow keys should adjust the focused handle's value. Appropriate ARIA attributes (e.g., role="slider", aria-valuenow, aria-valuemin, aria-valuemax, aria-label) should be used to make the component accessible.RangeSlider component renders correctly with initial min and max values.Tab focuses on the handles.Left Arrow or Right Arrow keys adjusts the focused handle's value by one step.onChange callback is invoked with the correct [min, max] values when the selection changes.Constraints
1 unit for keyboard interactions.onChange calls (call immediately on value change).1).Loading editor...