JSPM

react-rpg-dice

1.0.1
    • ESM via JSPM
    • ES Module Entrypoint
    • Export Map
    • Keywords
    • License
    • Repository URL
    • TypeScript Types
    • README
    • Created
    • Published
    • 0
    • Score
      100M100P100Q15892F
    • License ISC

    configurable react dice roller for RPG dice

    Package Exports

    • react-rpg-dice

    Readme

    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