🎮 Try the Live Demo — Range, vertical, pushable, time-of-day and more.
📚 View the API Documentation
This is a modernized fork of the excellent React Compound Slider by Steve Hall. We have created this fork because the original library is no longer maintained, and we rely on it for our existing production projects. Our goal is to keep this library alive, secure, and compatible with the latest versions of React.
Maintained by: Felipe Carrillo
Welcome to the future. Replace Compound Slider is a fully modernized, high-performance slider component for React. It maintains the original's "no-opinion" philosophy about markup and styles while bringing the codebase up to 2026 standards.
npm install replace-compound-slider
Migrating is designed to be a 5-minute task with zero breaking changes to the public API.
npm uninstall react-compound-slider
npm install replace-compound-slider
- import { Slider, Rail, Handles, Tracks, Ticks } from 'react-compound-slider'
+ import { Slider, Rail, Handles, Tracks, Ticks } from 'replace-compound-slider'
ref on the <Slider /> component now returns the underlying DOM element (HTMLDivElement), which is the standard for modern React libraries.This library aims to be a stable platform for creating slider components with a very small impact on bundle size. It is primarily aimed at application developers and npm package maintainers. You can create your own set of controls matched exactly to your application style, but it takes a little more effort than other components out there. You need to be comfortable handling what gets rendered and styling your components to really get maximum value from this library.
import { Slider, Rail, Handles, Tracks, Ticks } from 'replace-compound-slider'
<Slider
domain={[0, 100]}
values={[20, 60]}
step={1}
>
<Rail>
{({ getRailProps }) => (
<div className="rail-style" {...getRailProps()} />
)}
</Rail>
<Handles>
{({ handles, getHandleProps }) => (
<div className="slider-handles">
{handles.map(handle => (
<Handle
key={handle.id}
handle={handle}
domain={[0, 100]}
getHandleProps={getHandleProps}
/>
))}
</div>
)}
</Handles>
<Tracks left={false} right={false}>
{({ tracks, getTrackProps }) => (
<div className="slider-tracks">
{tracks.map(({ id, source, target }) => (
<Track
key={id}
source={source}
target={target}
getTrackProps={getTrackProps}
/>
))}
</div>
)}
</Tracks>
</Slider>
Original artwork and logic by Steve Hall. Modernization and maintenance by Felipe Carrillo. Slider Artwork by Guilhem from the Noun Project.