All Projects → jesster2k10 → react-native-range-slider

jesster2k10 / react-native-range-slider

Licence: MIT license
A high-quality, cross platform, native iOS range slider for react native. A slider, similar in style to UISlider, but which allows you to pick a minimum and maximum range; inspired by react-native-range-slider

Programming Languages

java
68154 projects - #9 most used programming language
objective c
16641 projects - #2 most used programming language
typescript
32286 projects
kotlin
9241 projects
ruby
36898 projects - #4 most used programming language
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to react-native-range-slider

RangeUISlider
📱 🔵➖🔵 An iOS range selection slider compatible with UIKit and SwiftUI. Developed using autolayout and highly customizable using IBDesignabled and IBInspectable or programmatically. It support also RTL (right to left) languages automatically out of the box.
Stars: ✭ 98 (+113.04%)
Mutual labels:  range-slider, slider-range, rangeslider
Boxedverticalseekbar
A vertical seekbar for Android
Stars: ✭ 133 (+189.13%)
Mutual labels:  seekbar, range-slider
slider
Vue 3 slider component with multihandles, tooltips merging and formatting (+Tailwind CSS support).
Stars: ✭ 162 (+252.17%)
Mutual labels:  range-slider, slider-range
andColorPicker
Color picker library for Android
Stars: ✭ 233 (+406.52%)
Mutual labels:  seekbar, seekbar-android
RangeSeekBar
Android Range Seekbar library that support Min & Max Value for API level >= 16 and support Step Value
Stars: ✭ 97 (+110.87%)
Mutual labels:  seekbar, seekbar-android
Ion.rangeslider
jQuery only range slider
Stars: ✭ 2,494 (+5321.74%)
Mutual labels:  range-slider, rangeslider
Rangeslider.js
🎚 HTML5 input range slider element polyfill
Stars: ✭ 2,153 (+4580.43%)
Mutual labels:  range-slider, rangeslider
Rangeseekbar
A beautiful and powerful SeekBar what supports single、 range、steps、vetical、custom( 一款美观强大的支持单向、双向范围选择、分步、垂直、高度自定义的SeekBar)
Stars: ✭ 2,037 (+4328.26%)
Mutual labels:  seekbar, slider-range
Indicatorseekbar
A custom SeekBar on Android, which can be changed the size ,color , thumb drawable , tick drawable , tick text and indicator , also , will show an indicator view with progress above SeekBar when seeking. https://github.com/warkiz/IndicatorSeekBar
Stars: ✭ 1,836 (+3891.3%)
Mutual labels:  seekbar
SeekBarWithIntervals
No description or website provided.
Stars: ✭ 53 (+15.22%)
Mutual labels:  seekbar
Waveformseekbar
Android Waveform SeekBar library
Stars: ✭ 120 (+160.87%)
Mutual labels:  seekbar
Tickseekbar
This is a custom SeekBar library on Android.
Stars: ✭ 155 (+236.96%)
Mutual labels:  seekbar
vue-histogram-slider
Range slider with histogram for Vue.js
Stars: ✭ 111 (+141.3%)
Mutual labels:  range-slider
data-driven-range-slider
D3.js based data-driven range slider, date time support
Stars: ✭ 21 (-54.35%)
Mutual labels:  range-slider
wui
Collection of GUI widgets for the web
Stars: ✭ 44 (-4.35%)
Mutual labels:  rangeslider
Kotlin Playground
Kotlin practice
Stars: ✭ 111 (+141.3%)
Mutual labels:  seekbar
Arcseekbar
🎡 ArcSeekBar 一个弧形可拖动进度条控件。弧形大小,弧度,颜色渐变等配置完全可定制化
Stars: ✭ 115 (+150%)
Mutual labels:  seekbar
Bezierseekbar
Beautiful custom View, SeekBar selector, easy to use, and rich in customization.漂亮的区间选择器,贝塞尔曲线优雅实现
Stars: ✭ 252 (+447.83%)
Mutual labels:  seekbar
Colorseekbar
A colorful SeekBar for picking color
Stars: ✭ 249 (+441.3%)
Mutual labels:  seekbar
AORangeSlider
AORangeSlider is a custom UISlider with two handlers to pick a minimum and a maximum range.
Stars: ✭ 82 (+78.26%)
Mutual labels:  rangeslider

React Native Range Slider

A high-quality, cross platform, native iOS range slider for react native. A slider, similar in style to UISlider, but which allows you to pick a minimum and maximum range; inspired by react-native-range-slider

Features

  • iOS Support
  • Android Support
  • Native Code
  • Customizable
  • Typescript Support

IOS Example

IOS Demo

Android Example

IOS Demo

Installation

Install the library using either yarn or npm like so:

yarn add @jesster2k10/react-native-range-slider
npm install --save @jesster2k10/react-native-range-slider

IOS Installation

If you're using React Native versions > 60.0, it's relatively straightforward.

cd ios && pod install

For versions below 0.60.0, use rnpm links

  • Run react-native link @jesster2k10/react-native-range-slider
  • If linking fails, follow the manual linking steps

Android Installation

For versions below 0.60.0, follow the linking instructions above. There are additional steps required to get started with android.

Step One

Modify your settings.gradle to include the following

include ':rangeseekbar'
project(':rangeseekbar').projectDir = new File(rootProject.projectDir, '../node_modules/@jesster2k10/react-native-range-slider/android/crystalrangeseekbar')

Step Two

Modify and your application build.gradle to include:

buildscript {
  dependencies {
    classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
    classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
  }
}

Step Three

NOTE: This only applies to react native versions greater than 0.60.0 *NOTE: if you don't have a react-native.config.js file, just create one at the root of your project

Adjust your react-native.config.js to include the following:

module.exports = {
  dependencies: {
    '@jesster2k10/react-native-range-slider': {
      platforms: {
        android: {
          packageImportPath:
            'import com.jesster2k10reactnativerangeslider.ReactNativeRangeSliderPackage;',
        },
      },
    },
  },
}

Step Four

Modify your AndroidManifest.xml and set android:allowBackup="true", see below for example:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  package="com.ReactNativeRangeSliderExample">

    <uses-permission android:name="android.permission.INTERNET" />

    <application
      android:name=".MainApplication"
      android:label="@string/app_name"
      android:icon="@mipmap/ic_launcher"
      android:roundIcon="@mipmap/ic_launcher_round"
      android:allowBackup="true"
      android:theme="@style/AppTheme">
      <activity
        android:name=".MainActivity"
        android:label="@string/app_name"
        android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
        android:windowSoftInputMode="adjustResize">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
      </activity>
      <activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
    </application>

</manifest>

Usage

Basic Usage

You can check out the examples for more usage.

import RangeSlider from '@jesster2k10/react-native-range-slider';

// ...
const App = () => {
  const onChange = (min: number, max: number) => {
    console.log('min: ', min)
    console.log('max: ', max)
  }

  return (
  <RangeSlider
    type="range" // ios only
    min={0}
    max={100}
    selectedMinimum={20} // ios only
    selectedMaximum={60} // ios only
    tintColor="#ecf0f1"
    handleColor="#f368e0"
    handlePressedColor="#f368e0"
    tintColorBetweenHandles="#ff9ff3"
    onChange={onChange}
  />
  )
}

## Props

Props Explanation

Common Props

property type description required
min number the minimum value for the slider TRUE
max number the maximum value for the slider TRUE
onChange (min: number, max: number) => void a callback that will be called with slider data once the values change FALSE
tintColor string tint color for the slider track & handles (ios only, use handleColor on android) FALSE
tintColorBetweenHandles string tint color for the active part of the slider track FALSE
step number the step for the slider FALSE
handleColor string the color for both left and right handlers FALSE
style object a custom style object for the slider FALSE
prefix string the prefix for the min and max values
suffix string the suffix for the min and max values

IOS Only Props

property type description required
type slider range the type of slider
selectedMaximum number the selected maximum value, it shouldn't be less than max FALSE
selectedMinimum number the selected minimum value, it shouldn't be less than min FALSE
handleBorderColor string the color for the slider handle border FALSE
handleWidth number the size of the handle FALSE
minLabelColor string the color of the minimum (left hand) label FALSE
maxLabelColor string the color of the maximum (right hand) label FALSE
handleDiameter number the diameter of the handle FALSE
lineHeight number the height of the slider track FALSE
hideLabels boolean controls whether the min and max labels are visible FALSE
minLabelFont string the font family name of the min (left hand) label FALSE
minLabelFontSize number the font size of the min (left hand) label FALSE
maxLabelFont string the font family name of the max (right hand) label FALSE
maxLabelFontSize number the font size of the max (right hand) label FALSE
labelPadding number extra padding for the min & max labels FALSE
maxDistance number the maximum distance between handles FALSE
minDistance number the minimum distance between handles FALSE
lineBorderWidth number the border width of the slider track FALSE
lineBorderColor string the border color of the slider track FALSE

Android Only Props

property type description required
leftHandleColor string the color of the left handle FALSE
leftHandlePressedColor string the color of the left (min) handle when touched FALSE
rightHandleColor string the color of the right (max) handle FALSE
rightHandlePressedColor string the color of the right (max) handle when touched FALSE
handlePressedColor string the color of the handle when touched FALSE
minStartValue number - FALSE
maxStartValue number - FALSE
fixGap number a fixed gap between the handles FALSE
corderRadius number the corder radius of the slider track FALSE

Please note that on android, the tint color refers to the color of the empty track.

Acknowledgments

Roadmap

  • Improve android customization abilities (fonts, handle size)
  • Improve documentation
  • Unit tests
  • Flow support

Contribution

Please visit the CONTRIBUTING.md file.

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].