npm.io
1.0.1 • Published 1 year ago

react-rpg-dice

Licence
ISC
Version
1.0.1
Deps
0
Size
68 kB
Vulns
0
Weekly
0

react-rpg-dice

Click a die button to roll a die. Click multiple times to roll multiple dice.

Live Demo:

default

vertical orientation

custom dice

custom timeouts

custom roll function

image
Option Description
callback (required) function called with results of rolls (type Result = { result: number, sides: number, bonus: number })
orientation 'horizontal' (default) or 'vertical'
dice array of what sided dice (default [ 4, 6, 8, 10, 12, 20 ])
defaultTimeout how long to wait for additional dice before rolling
timeoutMultipliers multiplies defaultTimeout after certain numbers of dice in queue
diceRollFn roll calculator override