# @nghinv/react-native-slider

> React Native slider Library

Latest version **0.1.0** (published 2021-08-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install @nghinv/react-native-slider
pnpm add @nghinv/react-native-slider
yarn add @nghinv/react-native-slider
bun add @nghinv/react-native-slider
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2021-08-09 |
| First published | 2021-07-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 77.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | NghiNV |
| Maintainers | nghinv |
| Keywords | react-native, ios, android, slider, nghinv, react-native-slider, component |

## Links

- npm: https://www.npmjs.com/package/@nghinv/react-native-slider
- Repository: https://github.com/nghinv-software/react-native-slider
- Homepage: https://github.com/nghinv-software/react-native-slider#readme
- Issues: https://github.com/nghinv-software/react-native-slider/issues
- npm.io page: https://npm.io/package/@nghinv/react-native-slider

## Dependencies (2)

- [react-fast-compare](https://npm.io/package/react-fast-compare.md) *
- [@nghinv/react-native-animated](https://npm.io/package/@nghinv/react-native-animated.md) >=0.2.0

## Alternatives

- [adhdev](https://npm.io/package/adhdev.md) — 11.1K weekly downloads
- [react-slide-button](https://npm.io/package/react-slide-button.md) — 310 weekly downloads
- [better](https://npm.io/package/better.md) — 42 weekly downloads
- [react-native-swipe-image](https://npm.io/package/react-native-swipe-image.md) — 22 weekly downloads
- [nl.fokkezb.pulltorefresh](https://npm.io/package/nl.fokkezb.pulltorefresh.md) — 11 weekly downloads

## Recent versions

- 0.1.0 (latest) — 2021-08-09
- 0.0.2 (undefined) — 2021-07-14
- 0.0.5 — 2021-07-31
- 0.0.4 — 2021-07-30
- 0.0.3 — 2021-07-14
- 0.0.1 — 2021-07-14

## README

# @nghinv/react-native-slider

React Native Slider Library use reanimated 2

---

[![CircleCI](https://circleci.com/gh/nghinv-software/react-native-slider.svg?style=svg)](https://circleci.com/gh/nghinv-software/react-native-slider)
[![Version][version-badge]][package]
[![MIT License][license-badge]][license]
[![All Contributors][all-contributors-badge]][all-contributors]
[![PRs Welcome][prs-welcome-badge]][prs-welcome]

<p align="center">
<img src="./assets/demo.gif" width="300"/>
</p>

## Installation

```sh
yarn add @nghinv/react-native-slider
```

or 

```sh
npm install @nghinv/react-native-slider
```

- peerDependencies

```sh
yarn add react-native-gesture-handler react-native-reanimated
```

## Usage

```js
import React, { useState } from 'react';
import { View, StyleSheet } from 'react-native';
import Slider from '@nghinv/react-native-slider';

function App() {
  const [value, setValue] = useState(0);

  const onChange = useCallback((v) => {
    setValue(v);
  }, []);

  const onConfirm = useCallback((v) => {
    setValue(v);
  }, []);

  return (
    <View style={styles.container}>
      <Slider
        min={1}
        max={50}
        step={1}
        width={240}
        value={value}
        onChange={onChange}
        onConfirm={onConfirm}
      />
    </View>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    paddingHorizontal: 16,
  },
});

export default App;
```

# Property

| Property | Type | Default | Description |
|----------|:----:|:-------:|-------------|
| min | `number` | `0` |  |
| max | `number` | `100` |  |
| step | `number` | `1` |  |
| value | `number` | `0` |  |
| animatedValue | `Animated.SharedValue<number>` | `undefined` |  |
| width | `number \| string` | `undefined` |  |
| style | `ViewStyle` | `undefined` |  |
| thumbRadius | `number` | `4` |  |
| trackSize | `number` | `2` |  |
| thumbTintColor | `string` | `white` |  |
| lowerTrackColor | `string` | `#448aff` |  |
| upperTrackColor | `string` | `#616161` |  |
| onStart | `() => void` | `undefined` |  |
| onChange | `(value: number) => void` | `undefined` |  |
| onConfirm | `(value: number) => void` | `undefined` |  |
| disabled | `boolean` | `false` |  |
| touchScale | `number` | `1.6` |  |
| hitSlop | `number` | `16` |  |
| hapticFeedback | `boolean` | `false` |  |


---
## Credits

- [@Nghi-NV](https://github.com/Nghi-NV)

[version-badge]: https://img.shields.io/npm/v/@nghinv/react-native-slider.svg?style=flat-square
[package]: https://www.npmjs.com/package/@nghinv/react-native-slider
[license-badge]: https://img.shields.io/npm/l/@nghinv/react-native-slider.svg?style=flat-square
[license]: https://opensource.org/licenses/MIT
[all-contributors-badge]: https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square
[all-contributors]: #contributors
[prs-welcome-badge]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square
[prs-welcome]: http://makeapullrequest.com

---
_Source: https://npm.io/package/@nghinv/react-native-slider · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
