0.2.1 • Published 3 years ago

react-random-roller v0.2.1

Weekly downloads
6
License
MIT
Repository
github
Last release
3 years ago

React Random Roller

Random list selecting component tool thing

Motivation

I wanted to recreate the old UrbanSpoon random food selector and the idea for this component was born.

Tech/framework used

Built with

Features

Randomly selects an item from a list, visually.

Code Example

...

import RandomRoller from 'react-random-roller';


<RandomRoller list={ ['Hello,', 1, <p>world</p>] } />

Installation

npm i -S react-random-roller

API Reference

1. RandomRoller

Random Selection Component

E.g.:

<ReactRoller fps={ 60 } duration={ 2000 } list={ [1, 2, 3, 4, 5, 6] } />
PropertyTypeRequiredDefault valueDescription
classNamestringno<See the source code>Custom css class for the component
fpsnumberno60Frames per second the item should be animating at
durationnumberno2000Amount of time the animation should last in milliseconds
listarrayyesList of items to select from
autobooleannoFalseRun the roller after mounting, immediately.
messagestringnoClick to PickCustom click message.

Tests

At this time there are no test in place, I hope to get to that in the near future

Contribute

If you would like to contribute, please fork this repo and submit a pull request. Thank you!

License

MIT © Corey Trombley

0.2.1

3 years ago

0.2.0

3 years ago

0.1.1

6 years ago

0.1.0

6 years ago