Socket
Socket
Sign inDemoInstall

react-native-range

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    react-native-range

Android and iOS supported pure js range slider component with multiple markers / thumbs for React Native


Version published
Weekly downloads
17
decreased by-19.05%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

react-native-range

Pure JS react native range slider component with one or two markers / thumbs. Options to customize track, touch area and provide customer markers and callbacks for touch events and value changes.

Examples

cd example
npm install
react-native run-ios
react-native run-android

Example

Getting Started

  • Installation

Installation

$ npm install --save react-native-range

Usage in a ScrollView

 enableScroll = () => this.setState({ scrollEnabled: true });
 disableScroll = () => this.setState({ scrollEnabled: false });
 
 render() {
   return (
     <ScrollView scrollEnabled={this.state.scrollEnabled}>
      <MultiSlider
        ...
        onValuesChangeStart={this.disableScroll}
        onValuesChangeFinish={this.enableScroll}
      />
    </ScrollView>
    );

shape up CustomMarker as left and right

In order to make different styles on markers you can set isMarkersSeparated to true, define customMarkerLeft and customMarkerRight in MultiSlider. for example:

<MultiSlider
     ...
      isMarkersSeparated={true}
      
      customMarkerLeft={(e) => {
         return (<CustomSliderMarkerLeft
          currentValue={e.currentValue}/>)
          }}
         
         customMarkerRight={(e) => {
         return (<CustomSliderMarkerRight
         currentValue={e.currentValue}/>)
         }}
     />

Partial report of the props

Feel free to contribute to this part of the documentation.

Prop nameDefault valueTypePurpouse
values[0]array of numbersPrefixed values of the slider.
onValuesChangeStart() => {}functionCallback when the value starts changing
onValuesChange() => {}functionCallback when the value changes
onValuesChangeFinish(values) => {}functionCallback when the value stops changing
sliderLength280numberLength of the slider (?)
touchDimensions{height: 50,width: 50,borderRadius: 15,slipDisplacement: 200}object(?)
customMarkerfunctionComponent used for the cursor.
customMarkerLeftfunctionComponent used for the left cursor.
customMarkerRightfunctionComponent used for the right cursor.
isMarkersSeparatedboolean(?)
min0numberMinimum value available in the slider.
max10numberMaximum value available in the slider.
step1numberStep value of the slider.
optionsArrayarray(?)
{container/track/selected/unselected/ markerContainer/marker/pressedMarker} Stylestyle objectStyles for the slider
valuePrefixstringPrefix added to the value.
valueSuffixstringSuffix added to the value.
enabledOnetruebooleanEnables the first cursor
enabledTwotruebooleanEnables the second cursor
onToggleOneundefinedfunction callbackListener when first cursor toggles.
onToggleTwoundefinedfunction callbackListener when second cursor toggles.
allowOverlapfalsebooleanAllow the overlap within the cursors.
snappedfalseboolean(?)
markerOffsetX0numberOffset first cursor.
markerOffsetY0numberOffset second cursor.

Keywords

FAQs

Last updated on 05 Nov 2018

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc