# react-native-expandable-slider

> Expandable slider for React Native

Latest version **1.0.4** (published 2021-12-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-native-expandable-slider
pnpm add react-native-expandable-slider
yarn add react-native-expandable-slider
bun add react-native-expandable-slider
```

## Health

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

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

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2021-12-04 |
| First published | 2021-03-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 72.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Thanh Tùng |
| Maintainers | thanhtunguet |
| Keywords | react-native, ios, android |

## Links

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

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 1.0.4 (latest) — 2021-12-04
- 1.0.3 — 2021-06-30
- 1.0.2 — 2021-04-03
- 1.0.1 — 2021-03-28
- 1.0.0 — 2021-03-28
- 0.1.5 — 2021-03-09
- 0.1.4 — 2021-03-09
- 0.1.3 — 2021-03-09
- 0.1.2 — 2021-03-09
- 0.1.1 — 2021-03-09

## README

# react-native-expandable-slider

_Phillips Hue dimming slider_

![screenshot](https://im.ge/i/uQh80)

## Installation

```sh
npm install react-native-expandable-slider
```

## Usage

View [Online Demo](https://snack.expo.io/@thanhtunguet/react-native-expandable-slider) Snack

If you place this component inside ScrollView, please set `canCancelContentTouches={false}` for ScrollView container

See [https://stackoverflow.com/questions/51705343/react-native-using-a-panresponder-inside-of-a-scrollview-broken-on-android](https://stackoverflow.com/questions/51705343/react-native-using-a-panresponder-inside-of-a-scrollview-broken-on-android)

```tsx
import ExpandableSlider from 'react-native-expandable-slider';

function Example() {
  return (
    <ExpandableSlider
      min={800}
      max={20000}
      value={value}
      onSlide={handleValueChange}
      heightRef={heightRef}
      style={styles.slider}
    />
  );
}
```

### Props

```tsx
interface ExpandableSliderProps {
  /**
   * Size of the slider indicator (px)
   *
   * @type {number}
   */
  indicatorSize?: number;

  /**
   * Min value the slider will emit
   *
   * @type {number}
   */
  min?: number;

  /**
   * Max value the slider will emit
   *
   * @type {number}
   */
  max?: number;

  /**
   * Current value to display
   *
   * @type {number}
   */
  value?: number;

  /**
   * The slider outer style
   *
   * @type {StyleProp<ViewStyle>}
   */
  style?: ViewProps['style'];

  /**
   * Trigger a haptic response when user touch the slider
   *
   * @type {boolean}
   */
  useHapticResponse?: boolean;

  /**
   * A mutable ref object of type number,
   * let the slider know how wide it will expand
   */
  heightRef?: MutableRefObject<number>;

  /**
   * Emit new value while sliding
   *
   * @type {(value: number) => (void | Promise<void>)}
   */
  onSlide?: OnSliderChange;

  /**
   * Emit new value when sliding completed
   *
   * @type {(value: number) => (void | Promise<void>)}
   */
  onSlideCompleted?: OnSliderChange;

  /**
   * Velocity of the slider animation
   */
  slidingVelocity?: number;

  /**
   * Slider's height animated duration
   */
  heightAnimatedDuration?: number;
}
```

## Contributing

See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.

## License

MIT

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