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

react-native-range-slider-expo

Package Overview
Dependencies
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-range-slider-expo

Customizable range slider for react native apps and compatible with Expo projects

  • 1.4.3
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
499
decreased by-4.95%
Maintainers
1
Weekly downloads
 
Created
Source

react-native-range-slider-expo

Supports Android and iOS    MIT License

Customizable range slider for react native apps



Getting started

npm i react-native-range-slider-expo



Usage

Examples - display

Examples - code (reflects the short video above)
import RangeSlider, { Slider } from 'react-native-range-slider-expo';
     const [fromValue, setFromValue] = useState(0);
     const [toValue, setToValue] = useState(0);
     const [value, setValue] = useState(0);
     return (
          <View style={styles.container}>
               <View>
                    <RangeSlider min={5} max={25}
                         fromValueOnChange={value => setFromValue(value)}
                         toValueOnChange={value => setToValue(value)}
                         initialFromValue={11}
                    />
                    <Text>from value:  {fromValue}</Text>
                    <Text>to value:  {toValue}</Text>
               </View>
               <View>
                    <Slider min={0} max={40} step={4}
                         valueOnChange={value => setValue(value)}
                         initialValue={12}
                         knobColor='red'
                         valueLabelsBackgroundColor='black'
                         inRangeBarColor='purple'
                         outOfRangeBarColor='orange'
                    />
                    <Text>value:  {value}</Text>
               </View>
          </View>
     );

API - RangeSlider (default import)

PropertyTypeRequiredDefault
minnumberyes-
maxnumberyes-
fromValueOnChangecallbackyes-
toValueOnChangecallbackyes-
stepnumberno1
styleSizestring ( 'small' | 'medium' | 'large' | number )no'medium'
fromKnobColorstring (color)no'#00a2ff'
toKnobColorstring (color)no'#00a2ff'
inRangeBarColorstring (color)no'rgb(100,100,100)'
outOfRangeBarColorstring (color)no'rgb(200,200,200)'
valueLabelsBackgroundColorstring (color)no'#3a4766'
rangeLabelsTextColorstring (color)no'rgb(60,60,60)'
showRangeLabelsbooleannotrue
showValueLabelsbooleannotrue
initialFromValuenumbernoas 'min' value
initialToValuenumbernoas 'max' value
knobSizenumberno24/34/44
containerStylestyleno-
barHeightnumberno8/11/15
labelFormatter(value: number) => stringno-

API - Slider (1 knob)

PropertyTypeRequiredDefault
minnumberyes-
maxnumberyes-
valueOnChangecallbackyes-
stepnumberno1
styleSizestring ( 'small' | 'medium' | 'large' | number )no'medium'
knobColorstring (color)no'#00a2ff'
inRangeBarColorstring (color)no'rgb(200,200,200)'
outOfRangeBarColorstring (color)no'rgb(100,100,100)'
valueLabelsTextColorstring (color)no'white'
valueLabelsBackgroundColorstring (color)no'#3a4766'
rangeLabelsTextColorstring (color)no'rgb(60,60,60)'
showRangeLabelsbooleannotrue
showValueLabelsbooleannotrue
initialValuenumbernoas 'min' value
containerStylestyleno-
barHeightnumberno8/11/15
labelFormatter(value: number) => stringno-

API - Textual Slider

PropertyTypeRequiredDefault
values[ItemType]yes-
valueOnChangecallbackyes-
styleSizestring ( 'small' | 'medium' | 'large' | number )no'medium'
knobColorstring (color)no'#00a2ff'
inRangeBarColorstring (color)no'rgb(200,200,200)'
outOfRangeBarColorstring (color)no'rgb(100,100,100)'
valueLabelsTextColorstring (color)no'white'
valueLabelsBackgroundColorstring (color)no'#3a4766'
rangeLabelsTextColorstring (color)no'rgb(60,60,60)'
showRangeLabelsbooleannotrue
showValueLabelsbooleannotrue
initialValuenumberno-



License

This project is licensed under the MIT License



Todo

  • Add plain slider (with 1 knob)
  • Add initial values
  • Add numeric style size
  • Add textual values
  • Add prefix/suffix to numeric values
  • Beautify styling

Keywords

FAQs

Package last updated on 22 May 2022

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