Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docs][slider] Add range slider example #1527

Open
raclee7 opened this issue Mar 3, 2025 · 3 comments · May be fixed by #1600
Open

[docs][slider] Add range slider example #1527

raclee7 opened this issue Mar 3, 2025 · 3 comments · May be fixed by #1600
Labels
component: slider This is the name of the generic UI component, not the React module! docs Improvements or additions to the documentation

Comments

@raclee7
Copy link

raclee7 commented Mar 3, 2025

Feature request

Summary

Support dual thumbs for a ranged slider (currently supports one https://base-ui.com/react/components/slider)

Examples in other libraries

https://ant.design/components/slider

Image

Motivation

When there are multiple values given to a slider, we need to support dual+ thumbs for UI purposes

@raclee7 raclee7 added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Mar 3, 2025
@mj12albert
Copy link
Member

Hey @raclee7 this is already supported, pass an array to value or defaultValue and place one Slider.Thumb per value:

<Slider.Root defaultValue={[20, 60]}>
  <Slider.Control>
    <Slider.Track>
      <Slider.Indicator />
      <Slider.Thumb />
      <Slider.Thumb />
    </Slider.Track>
  </Slider.Control>
</Slider.Root>

@mj12albert
Copy link
Member

mj12albert commented Mar 3, 2025

Somebody asked in Discord before if range sliders are supported as well, the only real mention of how is in this popover which is hard to discover:

Image

I think we need to add a demo or at least a snippet @colmtuite

@mj12albert mj12albert added docs Improvements or additions to the documentation component: slider This is the name of the generic UI component, not the React module! and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Mar 3, 2025
@mj12albert mj12albert changed the title Support dual thumb for a ranged slider [docs][slider] Add range slider example Mar 3, 2025
@mj12albert mj12albert self-assigned this Mar 3, 2025
@raclee7
Copy link
Author

raclee7 commented Mar 3, 2025

Hey @mj12albert that makes sense. Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: slider This is the name of the generic UI component, not the React module! docs Improvements or additions to the documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants