@acrool/react-jackpot
Version:
Jackpot list with React Component
81 lines (52 loc) • 2.28 kB
Markdown
# Acrool React Jackpot
<a href="https://acrool-react-jackpot.pages.dev/" title="Acrool React Jackpot - Fast custom jackpot for Reactjs">
<img src="https://raw.githubusercontent.com/acrool/acrool-react-jackpot/main/example/public/og.webp" alt="Acrool React Jackpot Logo"/>
</a>
<p align="center">
Fast custom jackpot for Reactjs
</p>
<div align="center">
[](https://www.npmjs.com/package/@acrool/react-jackpot)
[](https://github.com/acrool/@acrool/react-jackpot/blob/main/LICENSE)
[](https://github.com/acrool/react-jackpot/blob/main/LICENSE)
[](https://www.npmjs.com/package/@acrool/react-jackpot)
[](https://www.npmjs.com/package/@acrool/react-jackpot)
</div>
## Features
- Support custom length
## Install
```bash
yarn add @acrool/react-jackpot
```
## Usage
add in your index.tsx
```tst
import "@acrool/react-jackpot/dist/index.css";
```
then in your page
```tsx
import {Flex, fr, Grid} from '@acrool/react-grid';
import styled from 'styled-components';
import {Jackpot} from '@acrool/react-jackpot';
import {generatorArray} from '@acrool/js-utils/array';
import {useRef} from "react";
const Example = () => {
const [amount, setAmount] = useState(32767);
const timeRef = useRef<Node.Timer>(null);
useEffect(() => {
timeRef = setInterval(() => {
onChange(getRandom(1000));
}, 3000);
return () => {
clearInterval(timeRef.current);
};
}, []);
return (
<Jackpot length={7} amount={amount}/>
);
export default Example;
```
There is also a example that you can play with it:
[](https://acrool-react-jackpot.pages.dev)
## License
MIT © [Acrool](https://github.com/acrool) & [Imagine](https://github.com/imagine10255)