Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-native-range-slider

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-range-slider

The native slider for react native with multiple markers

  • 0.1.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

React Native Range Slider

The high-quality 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.

Note: This slider can also be used as a normal slider with only one handle.


Demo

Getting Started

  1. Installation

    • Using npm: npm install --save react-native-range-slider
    • Using yarn: yarn add react-native-range-slider
  2. Link

Usage

If you want a working example you can check this example, otherwise you can use the following example as a starting point.

import RangeSlider from 'react-native-range-slider'
<View style={{flex: 1, flexDirection: 'row'}}>
  <RangeSlider
    minValue={0}
    maxValue={100}
    tintColor={'#da0f22'}
    handleBorderWidth={1}
    handleBorderColor="#454d55"
    selectedMinimum={20}
    selectedMaximum={40}
    style={{ flex: 1, height: 70, padding: 10, backgroundColor: '#ddd' }}
    onChange={ (data)=>{ console.log(data);} }
  />
</View>

API

PropertyDescriptionType
disableRangewhen set to true, the slider will mimic a normal slider with only one handle and the slider value will be stored in selectedMaximumBoolean, false by default
minValuethe minimum value for the sliderNumber(float)
maxValuethe maximum value for the sliderNumber(float)
selectedMinimumthe selected minimum value, it shouldn't be less than minValueNumber(float)
selectedMaximumthe selected maximum value, it shouldn't be bigger than maxValueNumber(float)
onChangea callback that will be called with slider data once the values changeCallback
tintColorthe color for the slider bar and the two handlersString(MUST BE A HEX VALUE)
handleColorthe color for both selectedMinimum and selectedMaximum handlersString(MUST BE A HEX VALUE)
handleBorderColorthe color for the slider handle borderString(MUST BE A HEX VALUE)
handleBorderWidththe width for the slider handle borderNumber(float)
handleDiameterthe diameter for the slider handleNumber(float) default 16.0
tintColorBetweenHandlesthe color of the slider bar between the selectedMinimum and selectedMaximum handlersString(MUST BE A HEX VALUE)
minLabelColourthe color of the min label on top of selectedMinimum handlerString(MUST BE A HEX VALUE)
maxLabelColourthe color of the max label on top of selectedMaximum handlerString(MUST BE A HEX VALUE)
lineHeightthe height for slider barNumber(float) default 1.0)
preffixthe string to be prepended to min and max labels valuesString
suffixthe string to be appended to min and max labels valuesString
hideLabelsa boolean to determine handle labels visibility, if set to true range labels will be hiddenBoolean

Todo

  • Add possibility to update handlers related properties.
  • Impliment other necessary methods.
  • Improve the documentation.
  • Make the module cooler.
  • Add android support.

Acknowledgement

How to contribute ?

You are interested and want to contribute? Awesome, just consider the following steps:

  1. Fork this repository.
  2. Add and test the fixes/improvements you worked on to a seperate branch.
  3. Submit your pull request(PR).

Keywords

FAQs

Package last updated on 05 Mar 2019

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc