An open API service indexing awesome lists of open source software.

https://github.com/kunukn/react-fuzzy-toggle


https://github.com/kunukn/react-fuzzy-toggle

Last synced: about 2 months ago
JSON representation

Awesome Lists containing this project

README

        

# react-fuzzy-toggle

Interruptible toggle with a state between 0 and 1.
You can reverse the toggle direction before it has finished the toggling.

## npm

https://www.npmjs.com/package/react-fuzzy-toggle

## cdn

https://unpkg.com/react-fuzzy-toggle/

## demo

* npm install
* npm start

```js
import { FuzzyToggle } from 'react-fuzzy-toggle';

{/* optional callback when full happens */}}
onEmpty={({hasReversed}) => {/* optional callback */}}
onIncreasing={({range, hasReversed}) => {/* optional callback */}}
onDecreasing={({range, hasReversed}) => {/* optional callback */}}
render={({
onToggle,
range,
toggleState,
isFuzzy,
hasReversed,
}) => (




toggle



value between 0 and 1 included: {range.toFixed(1)}

full, empty, increasing or decreasing: {toggleState}

if range is between 0 and 1 not included: {isFuzzy}



)}
/>
```