A customizable range slider library for React Native with smooth animations (probably) and gesture support.
This monorepo contains the following packages:
A comprehensive slider library featuring both single value and range selection components.
Features:
- 🎯 Single Value & Range Selection - Two components for different use cases
- 🚀 High Performance - No promises right now 🤞
- 👆 Gesture Support - Pan and tap gestures with react-native-gesture-handler
- 🎨 Fully Customizable - Colors, sizes, themes, and styling options
- 🌓 Theme Support - Built-in light and dark themes
- 📐 Step Values - Support for discrete value selection
- ♿ Accessible - Screen reader support and focus indicators
- 📱 Cross Platform - Works on iOS, Android, and Web
npm install @touchtech/react-native-range-sliderimportReact,{useState}from'react';import{Slider,RangeSlider}from'@touchtech/react-native-range-slider';exportdefaultfunctionApp(){const[value,setValue]=useState(50);const[range,setRange]=useState<[number,number]>([20,80]);return(<View>{/* Single Value Slider */}<Slidermin={0}max={100}initialValue={value}onValueChange={setValue}theme="light"/>{/* Range Slider */}<RangeSlidermin={0}max={100}initialMin={range[0]}initialMax={range[1]}onRangeChange={(min,max)=>setRange([min,max])}theme="dark"/></View>);}Try the interactive demo to see all features in action:
# Clone the repository
git clone https://github.com/touchtechclub/react-native-range-slider.git
cd react-native-range-slider
# Install dependencies
bun install
# Run the demo appcd apps/demo
bun start
# Or run on specific platforms
bun run ios # iOS Simulator
bun run android # Android Emulator
bun run web # Web browserThis project uses a monorepo structure with the following apps and packages:
react-native-range-slider/
├── apps/
│ └── demo/ # Demo app showcasing the sliders
└── packages/
└── range-slider/ # Main slider package
├── src/
│ ├── lib/
│ │ ├── constants.ts # Shared constants and themes
│ │ └── utils.ts # Utility functions and hooks
│ ├── slider.tsx # Single value slider
│ ├── range-slider.tsx # Range slider
│ └── index.ts # Public exports
├── README.md # Package documentation
├── LICENSE # MIT License
└── package.json # Package configuration
- Node.js (v18 or higher)
- Bun (recommended) or npm/yarn
- React Native development environment set up
# Install dependencies for the entire monorepo
bun install
# Build the packagecd packages/range-slider
bun run build
# Watch mode for development
bun run dev
# Run the demo app to test changescd ../../apps/demo
bun start# In packages/range-slider/
bun run build # TypeScript compilation
bun run dev # Watch mode for development
bun run clean # Clean build artifacts
bun run pub:beta # Publish beta version
bun run pub:next # Publish next version
bun run pub:release # Publish production versionNo promises right now 🤞
// Light theme (default)<Slidertheme="light"/>// Dark theme<Slidertheme="dark"/><Slidertheme="dark"thumbColor="#FF6B6B"activeTrackColor="#FF6B6B"trackColor="#F0F0F0"thumbBorderColor="#E55555"thumbFocusRingColor="#FFD6D6"/>// Discrete steps<Slidermin={0}max={100}step={10}initialValue={50}/>// Precision values<Slidermin={0}max={5}step={0.1}initialValue={2.5}/>- Package README - Complete API documentation
- Demo App - Interactive examples and use cases
We welcome contributions!
- Fork the repository
- Create a feature branch
- Make your changes
- Test in the demo app
- Submit a pull request
MIT © TouchTech Club
Made with ❤️ by TouchTech Club