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 🙏

© 2024 – Pkg Stats / Ryan Hefner

rnr-slider

v1.0.14

Published

React Native Reanimated2 slider component

Downloads

19

Readme

rnr-slider

React Native component powered with Reanimated2 used to select a single value from a range of values

Installation and usage

To install this module do these terminal commands inside your project folder

Using Yarn:

yarn add rnr-slider

Using NPM:

npm install rnr-slider --save

Basic usage

As this component uses Reanimated2 library inside, it is important to use Reanimated2-hooks (e.g. useWorkletCallback) for the slider callbacks. Creates horizontal and vertical sliders.

import {Slider} from 'rnr-slider';

const Example = () => {
  const _onSlideStart = useWorkletCallback(e => {
    console.log('@start:', e);
  }, []);
  
  const _onSlideChange = useWorkletCallback(({value}) => {
    console.log('@change:', value);
  }, []);

  const _onSlideEnd = useWorkletCallback(e => {
    console.log('@end':, e);
  }, []);

  return (
    <Slider
      onSlideChange={_onSlideChange}
      onSlideStart={_onSlideStart}
      onSlideEnd={_onSlideEnd}
    />
  ) 
}

Main props

| Property | Description | Type | Required | | ------------- | ------------- | ------------- | ------------- | | onSlideChange | Main handler for slider value change. | function | Yes | | min | Minimum of values range.Default value is 0. | number | No | | max | Maximum of values range.Default is 100. | number | No | | defaultPercent | Default percent of where knob will initially render.Default is 0. | number | No | | onSlideStart | Additional handler which calls on slide start. | function | No | | onSlideEnd | Additional handler which calls on slide end. | function | No | | onDoubleTap | Additional handler which calls on knob double tap.Useful when we want to reset slider to its initial value. | function | No | | forwardedRef | Reference object. | React.RefObject | No | | withDecimals | Value in hint will be represented with floating point. | boolean | No | | isVertical | Make vertical slider. | boolean | No | | containerStyle | Slider container style. | ViewStyle | No |

Hint props

| Property | Description | Type | Required | | ------------- | ------------- | ------------- | ------------- | | withHint | Shows balloon with current slider value near knob. | boolean | No | | HintComponent | Custom hint component. | React.ReactElement | No |

Knob props

| Property | Description | Type | Required | | ------------- | ------------- | ------------- | ------------- | | knobSize | Size of native knob. | number | No | | knobStyle | Style of native knob. | ViewStyle | No | | knobVelocityLimitation | Velocity limitation of knob.Useful when we need to check specific slider value (e.g. for haptics). | number | No | | KnobComponent | Custom knob component. | React.ReactElement | No |

Progress bar props

| Property | Description | Type | Required | | ------------- | ------------- | ------------- | ------------- | | ProgressBarComponent | Custom progress bar container component. | React.ReactElement | No | | withAnimatedProgressBar | Shows ProgressBarFillComponent. | boolean | No | | ProgressBarFillComponent | Custom progress bar fill component.Works with withAnimatedProgressBar only!| React.ReactElement | No | | progressBarFillStyles | Style for custom progress bar fill. | ViewStyle | No |