
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
react-dice-roll
Advanced tools
A highly customizable dice roll package built in react.
Use the package manager yarn to install react-dice-roll.
yarn add react-dice-roll
or using npm
npm install react-dice-roll
import Dice from 'react-dice-roll';
<Dice onRoll={(value) => console.log(value)} />
| Prop | Type | Default | Description |
|---|---|---|---|
| rollingTime | number | 1000 | Rolling time for dice in milliseconds |
| onRoll | (value) => void | - | Function which receives the values between 1 - 6 after the dice roll |
| triggers | string[] | ['click'] | Accepts an array of key strings which replaces the default trigger of dice roll onClick. Multiple key strings can be passed as an array including the click to use multiple triggers for dice roll key. eg: ['Enter', 'a', 'click'] |
| defaultValue | number (1-6) | 6 | Default value of the dice before rolling |
| size | number | 250 | Dimensions of the dice in pixels |
| sound | string | - | URL for the sound to play on dice roll |
| disabled | boolean | - | Whether the dice is disabled or not |
| faces | string[] | - | Array of image urls for custom sides of the dice |
| faceBg | string | - | Custom background color for the dice face |
| placement | top-left, top-right, bottom-left, bottom-right | - | Placement of the device if put inside a relative positioned element |
| cheatValue | number (1-6) | - | Cheat Value for the dice. If passed, dice will always roll to this value |
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
MIT
FAQs
A highly customizable dice roll package built in react.
The npm package react-dice-roll receives a total of 148 weekly downloads. As such, react-dice-roll popularity was classified as not popular.
We found that react-dice-roll demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.