react-spectrum
react-spectrum copied to clipboard
Slider: ticks (marks) & snap to ticks
Provide a general summary of the feature here
Example: "Alert volume" slider in macOS Settings.
https://github.com/user-attachments/assets/55470628-2a65-48a6-8493-7f2e07285e8e
๐ค Expected Behavior?
- Allow to add multiple ticks (marks) to the slider
- May have optional labels above/below the track
- Clicking on the label should move the slider to the corresponding value
- Snap to ticks based on cursor movement (the behavior may vary depending on movement speed)
- Keyboard actions (e.g. arrow keys) should remain unaffected
๐ฏ Current Behavior
Currently, React Spectrum and React Aria do not have such features.
๐ Possible Solution
No response
๐ฆ Context
Use cases:
- Price slider, includes some ticks for commonly used values
- Volume balance slider, snap to 0
- Brightness slider in image editing app, snap to 0
๐ป Examples
No response
๐งข Your Company/Team
No response
๐ท Tracking Issue
No response
Seems like this is different from just using steps since you can still set the value between steps. I think this is a pretty advanced use case that may be better suited to have implemented by using a controlled value.