npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

react-native-fast-range-slider

v0.4.0

Published

A high-performance React Native range slider with smooth animations and precise touch controls using react-native-reanimated

Readme

react-native-fast-range-slider

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.

Features

  • High performance using react-native-reanimated
  • Precise touch controls with react-native-gesture-handler
  • Smooth animations running on UI thread
  • Real-time value updates
  • Fully customizable styling
  • Accessibility support
  • Pure TypeScript implementation - no native code or linking needed
  • Configurable min/max values and step sizes
  • Support for minimum distance between thumbs
  • RTL (Right-to-Left) support
  • Works with Expo out of the box

Performance Benefits

This slider leverages two powerful libraries for optimal performance, while maintaining a pure JavaScript implementation:

  • react-native-reanimated: Runs animations directly on the UI thread, eliminating JS-bridge overhead and ensuring smooth 60 FPS animations
  • react-native-gesture-handler: Provides native-driven gesture handling, resulting in more responsive touch interactions compared to React Native's PanResponder

Both dependencies are widely adopted in the React Native ecosystem and don't require any additional native code configuration.

Preview

Prerequisites

This library requires react-native-reanimated and react-native-gesture-handler.

Expo Users

Both libraries are supported out of the box:

npx expo install react-native-reanimated react-native-gesture-handler

React Native CLI Users

  1. Install the packages:
yarn add react-native-reanimated react-native-gesture-handler
  1. Follow the additional setup instructions in:

Installation

npm install react-native-fast-range-slider
# or
yarn add react-native-fast-range-slider

Usage

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"
    />
  );
};

Props

| 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 |

Styling

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}
/>

Callbacks

<RangeSlider
  onValuesChange={(values) => {
    // Called while dragging
  }}
  onValuesChangeStart={(values) => {
    // Called when drag starts
  }}
  onValuesChangeFinish={(values) => {
    // Called when drag ends
  }}
/>

Accessibility

The slider supports screen readers with customizable labels:

<RangeSlider
  leftMarkerAccessibilityLabel="Minimum value"
  rightMarkerAccessibilityLabel="Maximum value"
/>

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT


Written by Amit Palomo

Made with create-react-native-library