Repository navigation
Replace react-slider with Radix slider - #2078
NAThompson wants to merge 1 commit into
Conversation
fb4780a to
fd242c9
Compare
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fd242c9 to
5571d32
Compare
|
Awesome, thank you! Been meaning to do this for a long time. Any difference in bundle size? |
|
Thanks! The demo bundle grows by 5.8 kB gzipped (+0.4%), mostly from Radix's small helper packages; |
|
Okay, that's not huge but it's not negligible either. I also notice a bit of complexity related to Radix offsetting the thumbs to keep them within the bounds of the slider track, and a whole chunk of code to take over the interaction ( Would you consider trying another implementation with the Base UI slider to compare? In the field of UI-less React components, I also know of React Aria's slider but the thumbs don't push each other when dragged, which isn't as nice, so I've discarded it. If Claude has other suggestions that lead to a simple and lightweight implementation, I'm all ears. |
|
@axelboc : I'm setting my claude on doing three implementations in different PRs-feel free to pick the one you like best and close the others. |
|
Thanks, good call. I tried Base UI and also a dependency-free version, both as draft PRs for side-by-side comparison:
The comparison table is in both PRs, and all three carry the same new tests. My preference is the built-in one, but happy to go with whichever you'd rather maintain. |
Replaces the unmaintained
react-slider(React ≤18 peer) with@radix-ui/react-sliderinDomainSliderandSlicingSlider, keeping the same look, props and behaviour, with new pointer and keyboard tests. Lets #2074 drop itsreact-sliderpeer exemption.🤖 Generated with Claude Code