
Security News
Vite Releases Technical Preview of Rolldown-Vite, a Rust-Based Bundler
Vite releases Rolldown-Vite, a Rust-based bundler preview offering faster builds and lower memory usage as a drop-in replacement for Vite.
react-native-fast-range-slider
Advanced tools
A high-performance React Native range slider with smooth animations and precise touch controls using react-native-reanimated
A high-performance React Native range slider component built with react-native-reanimated and react-native-gesture-handler for smooth animations and precise touch control. Pure JavaScript implementation - no native code required.
This slider leverages two powerful libraries for optimal performance, while maintaining a pure JavaScript implementation:
Both dependencies are widely adopted in the React Native ecosystem and don't require any additional native code configuration.
![]() |
This library requires react-native-reanimated and react-native-gesture-handler.
Both libraries are supported out of the box:
npx expo install react-native-reanimated react-native-gesture-handler
yarn add react-native-reanimated react-native-gesture-handler
npm install react-native-fast-range-slider
# or
yarn add react-native-fast-range-slider
import RangeSlider from 'react-native-fast-range-slider';
const YourComponent = () => {
const handleValuesChange = (values) => {
console.log('Current values:', values);
};
return (
<RangeSlider
initialMinValue={20}
initialMaxValue={80}
min={0}
max={100}
step={1}
// Style customization
width={300}
thumbSize={32}
trackHeight={2.5}
selectedTrackStyle={{ backgroundColor: '#2196F3' }}
unselectedTrackStyle={{ backgroundColor: '#CECECE' }}
thumbStyle={{ backgroundColor: 'white' }}
pressedThumbStyle={{ transform: [{ scale: 1.2 }] }}
// Behavior
enabled={true}
allowOverlap={false}
showThumbLines={true}
minimumDistance={16}
// Callbacks
onValuesChange={handleValuesChange}
onValuesChangeStart={(values) => console.log('Started:', values)}
onValuesChangeFinish={(values) => console.log('Finished:', values)}
// Accessibility
leftThumbAccessibilityLabel="Minimum value"
rightThumbAccessibilityLabel="Maximum value"
/>
);
};
Prop | Type | Required | Default | Description |
---|---|---|---|---|
Core Props | ||||
min | number | Yes | - | Minimum allowed value |
max | number | Yes | - | Maximum allowed value |
initialMinValue | number | No | min | Initial minimum value |
initialMaxValue | number | No | max | Initial maximum value |
step | number | No | 1 | Step size for value changes |
Customization Props | ||||
width | number | No | 270 | Width of the slider track |
thumbSize | number | No | 32 | Size of thumb handles |
trackHeight | number | No | 2.5 | Height of slider track |
minimumDistance | number | No | 16 | Minimum distance between thumbs |
showThumbLines | boolean | No | true | Show lines inside thumb handles |
Style Props | ||||
selectedTrackStyle | object | No | - | Style object for selected track portion |
unselectedTrackStyle | object | No | - | Style object for unselected track portion |
thumbStyle | object | No | - | Style object for both thumbs |
pressedThumbStyle | object | No | - | Style applied when thumb is pressed |
containerStyle | object | No | - | Style for the container view |
selectedTrackColor | string | No | '#2196F3' | Color of the selected track portion |
Behavior Props | ||||
enabled | boolean | No | true | Enable/disable slider |
allowOverlap | boolean | No | false | Allow thumbs to overlap |
Callback Props | ||||
onValuesChange | function | No | () => {} | Called while dragging |
onValuesChangeStart | function | No | () => {} | Called when drag starts |
onValuesChangeFinish | function | No | () => {} | Called when drag ends |
Accessibility Props | ||||
leftThumbAccessibilityLabel | string | No | "Left handle" | Accessibility label for left thumb |
rightThumbAccessibilityLabel | string | No | "Right handle" | Accessibility label for right thumb |
The component supports several style customization props:
<RangeSlider
// Track styles
selectedTrackStyle={{
backgroundColor: '#2196F3',
height: 4,
}}
unselectedTrackStyle={{
backgroundColor: '#CECECE',
height: 4,
}}
// Thumb styles
thumbStyle={{
backgroundColor: 'white',
borderColor: '#CECECE',
borderWidth: 0.5,
shadowColor: '#000',
shadowOffset: { width: 0, height: 2 },
shadowOpacity: 0.25,
shadowRadius: 3.84,
}}
// Pressed thumb style
pressedThumbStyle={{
transform: [{ scale: 1.2 }],
}}
// Container style
containerStyle={{
height: 50,
}}
// Show/hide thumb lines
showThumbLines={true}
/>
<RangeSlider
onValuesChange={(values) => {
// Called while dragging
}}
onValuesChangeStart={(values) => {
// Called when drag starts
}}
onValuesChangeFinish={(values) => {
// Called when drag ends
}}
/>
The slider supports screen readers with customizable labels:
<RangeSlider
leftMarkerAccessibilityLabel="Minimum value"
rightMarkerAccessibilityLabel="Maximum value"
/>
See the contributing guide to learn how to contribute to the repository and the development workflow.
MIT
Written by Amit Palomo
Made with create-react-native-library
FAQs
A high-performance React Native range slider with smooth animations and precise touch controls using react-native-reanimated
The npm package react-native-fast-range-slider receives a total of 10 weekly downloads. As such, react-native-fast-range-slider popularity was classified as not popular.
We found that react-native-fast-range-slider demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Vite releases Rolldown-Vite, a Rust-based bundler preview offering faster builds and lower memory usage as a drop-in replacement for Vite.
Research
Security News
A malicious npm typosquat uses remote commands to silently delete entire project directories after a single mistyped install.
Research
Security News
Malicious PyPI package semantic-types steals Solana private keys via transitive dependency installs using monkey patching and blockchain exfiltration.