npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@callstack/slider

v6.0.0

Published

React Native component allowing to use native Slider in your React Native app.

Readme

|iOS|Android| |:-:|:-:| |iOS Screenshot|Android Screenshot|

Installation & Usage

To install cd to your project and:

yarn add @callstack/slider

or

npm install @callstack/slider --save

If using iOS please remember to install cocoapods by running: npx pod-install

The following code presents the basic usage scenario of this library:

import Slider from '@callstack/slider';

// Slider with initial value of 5, taking 80% of container's width
<Slider
  step={1}
  value={5}
  minimumValue={-10}
  maximumValue={10}
  style={{width: "80%"}}
/>

Check out the example project for more examples.

Compatibility

To use this component you need to ensure you are using:

| React Native version | for | | :------------------: | :-----------------------------------: | | >=0.85. | @callstack/slider v6.0.0. | | >=0.76. | @react-native-community/slider v5.0.0 | | >=0.69. | @react-native-community/slider v4.5.1 |

Reach out on Discord

If you have any questions, issues or any other topic that you need an advise in, reach out to us on our channel on Discord under this 👉 link. See you there!

Properties

| Property | Description | Type | Default | | -------- | ----------- | ---- | ------- | | style | Used to style and layout the Slider. See StyleSheet.js and ViewStylePropTypes.js for more info. | View.style | | | minimumValue | Initial minimum value of the slider. | number | 0 | | maximumValue | Initial maximum value of the slider. | number | 1 | | value | Value of the slider. Can be used to programmatically control the position of the thumb, and entered once at the beginning it acts as the initial value.This is not a controlled component, you don't need to update the value while the user is dragging.Ignored by a ranged slider, which is positioned by valueLeft and valueRight instead. | number | 0 | | ranged | Whether the slider selects a span of its range with two thumbs, rather than a single value with one. | bool | false | | valueLeft | Value of the thumb bounding the selected span from below.Behaves like value, and is only used by a ranged slider. The thumb cannot be dragged past valueRight. | number | minimumValue | | valueRight | Value of the thumb bounding the selected span from above.Behaves like value, and is only used by a ranged slider. The thumb cannot be dragged past valueLeft. | number | maximumValue | | lowerLimit | Limits the available range of the slider to the lower value. The user won't be able to slide below this limit.The track is still drawn from minimumValue. | number | minimumValue | | upperLimit | Limits the available range of the slider to the upper value. The user won't be able to slide above this limit.The track is still drawn up to maximumValue. | number | maximumValue | | step | Step defines the granularity of the slider. The value of the slider will always be a multiple of the step value.This works for both single and ranged sliders in the same manner.A step of 0 leaves the value continuous. | number | 0 | | orientation | The orientation of the Slider.Switches the way the Slider is displayed. A vertical Slider holds its lowest value at the bottom, and its highest at the top. | "horizontal" | "vertical" | "horizontal" | | disabled | Switches the Slider off. It is drawn in the platform's own disabled look, and takes no taps, clicks, drags or keyboard input, so none of the callbacks are called.The values given through the props still apply, so a disabled Slider keeps showing wherever they put its thumbs. It stays readable for screen readers, but cannot be reached by them.A custom track, thumb or stepMarkers component is dimmed along with the rest of the Slider, and is passed disabled so that it can draw the state its own way instead. | bool | false | | onValueChange | Callback continuously called while the user is dragging the thumb of a single Slider. A ranged Slider reports its thumbs through onLeftValueChange and onRightValueChange instead. | (value: number) => void | | | onLeftValueChange | Callback continuously called while the user is dragging the lower thumb of a ranged Slider. | (value: number) => void | | | onRightValueChange | Callback continuously called while the user is dragging the upper thumb of a ranged Slider. | (value: number) => void | | | onSlidingStart | Callback called each time the user starts dragging.The event is fired as soon as the user holds (long press) any thumb (left or right), regardless if the drag changed the value or not.A ranged Slider reports whichever of its thumbs was grabbed first, and does not report the second one being grabbed on top of it. | () => void | | | onSlidingComplete | Callback called each time the user ends dragging.The event is fired as soon as the user releases any thumb (left or right) after long press, regardless if the drag changed the value or not.A ranged Slider reports the last of its thumbs being released, so that every start is answered by exactly one complete. | () => void | | | thumb | Used to pass a custom component rendered as a thumb of the Slider, in place of the built-in one.A ranged Slider renders the given component twice, once for each of its thumbs. | FC<ThumbProps> | | | minimumTrackColor | Defines the color the track from minimumValue up to the thumb, or up to the left thumb (when ranged), will be. | color | | | middleRangeTrackColor | Defines the color the track from the left thumb to the right thumb will be.Only used by a ranged Slider. | color | | | maximumTrackColor | Defines the color the track from the thumb, or from the right thumb (when ranged), up to maximumValue will be. | color | | | track | Replaces the default (native) track with the given component.The component will be spread along the whole track by its X-axis, meaning that:* In a horizontal Slider, the width of the given component will be increased to the width of the track,* In a vertical Slider, the width of the given component will be increased as well, but the component will be transformed in the same 90 degrees as a vertical Slider is.NOTE, that the custom track component takes the priority against the minimumTrackColor, middleRangeTrackColor and maximumTrackColor. | FC<TrackProps> | | | stepMarkers | Renders steps below the track.NOTE: Is effective only when the step prop is set.true - switches on rendering of default, built-in steps indicatorsfalse - switches the steps rendering off.component - if a custom component is passed, switches the steps rendering on with the given component used to render each step. | boolean | FC<StepsProps> | false | | View | Inherited View props... | | |

Roadmap and Progress

There's a Project board available here which contains all reported issues organized into columns regarding their status.

If you are interested in knowing whether the issue you reported is handled or just to check the status of a feature you would like to have in Slider, please check the board.

Contributing

The main package implementation is done in the package/ directory. So when implementing changes there, make sure your code passes ESLint and the tests. Run the following to verify:

cd package/
npm run lint
npm run test
  • Remember to cover your changes with tests if possible.

When creating an issue please remember to specify the platform which the issue occurs on.

Running the example app

While developing, you can run the example app to test your changes.

Setup

  • Clone the repository
  • Run npm install in the root directory to install dependencies.
  • Run npm run example-<platform>, where platform can be: ios, android, windows

You can also do this manually by:

  • Installing node modules for example app
  • Installing pods for iOS app
  • Running example app like always: npx react-native run-<platform>

Maintainers


Made with ❤️ at Callstack

@callstack/react-native-slider is an open source project and will always remain free to use. If you think it's cool, please star it 🌟. Callstack is a group of React and React Native geeks, contact us at [email protected] if you need any help with these or just want to say hi!

Like the project? ⚛️ Join the team who does amazing stuff for clients and drives React Native Open Source! 🔥