Skip to content

feat(react-range-slider): introduce RangeSlider component#35751

Open
soniaboller wants to merge 13 commits intomicrosoft:react-range-sliderfrom
soniaboller:feat/react-ranger-slider-preview
Open

feat(react-range-slider): introduce RangeSlider component#35751
soniaboller wants to merge 13 commits intomicrosoft:react-range-sliderfrom
soniaboller:feat/react-ranger-slider-preview

Conversation

@soniaboller
Copy link
Copy Markdown

@soniaboller soniaboller commented Feb 12, 2026

Previous Behavior

Current Slider component only supports single input

New Behavior

This PR introduces a new RangeSlider component, which is part of the @fluentui/react-slider package. RangeSlider lets users select a bounded range (lower + upper value) along a shared rail, rather than a single point. Both thumbs can be dragged, touched, or adjusted with the keyboard. It shares the same visual treatment as the existing Slider (including small/medium sizes, horizontal/vertical orientation, LTR/RTL, step marks, and disabled state) but renders two native elements under the hood so both values are keyboard-operable, screen-reader accessible, and participate in form submissions.

When thumbs overlap (same value), the last-interacted thumb stays elevated and reachable. Pointer interactions use closest-thumb detection on click, with smooth drag via pointer capture. Each input's range is dynamically constrained to the other thumb's value, preventing crossover from the keyboard.

image

Additional changes:

  • extracted getPercent from Slider and adds it to @fluentui/react-utilities as a reusable @internal helper (with unit tests) so both components share it
  • added stories to demonstrate component
  • VR tests
  • unit tests

Related Issue(s)

@github-actions
Copy link
Copy Markdown

Pull request demo site: URL

@soniaboller soniaboller marked this pull request as ready for review February 19, 2026 00:50
@soniaboller soniaboller requested review from a team and dmytrokirpa as code owners February 19, 2026 00:50
@Hotell Hotell requested a review from mainframev February 19, 2026 13:04
Copy link
Copy Markdown
Contributor

@mainframev mainframev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When the thumbs overlap, the start thumb is always the active one - even if the user most recently interacted with the end thumb. Can we add a ref to track the last-used thumb, so when they overlap the correct thumb becomes active?

Screen.Recording.2026-03-02.at.14.47.15.mov

…st for initial state, input focus for touch, pointer events fix, story import updates
@soniaboller soniaboller requested a review from a team as a code owner March 3, 2026 21:54
Copy link
Copy Markdown
Contributor

@mainframev mainframev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@soniaboller

LGTM, regenerate api.md file so build pipeline pass :)

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants