All Projects → AdamTyler → react-dice-complete

AdamTyler / react-dice-complete

Licence: ISC license
Complete dice rolling functionality and animations

Programming Languages

javascript
184084 projects - #8 most used programming language
SCSS
7915 projects
HTML
75241 projects

Projects that are alternatives of or similar to react-dice-complete

rollem-telegram-bot
🎲 An RPG dice rolling bot for Telegram.
Stars: ✭ 26 (-56.67%)
Mutual labels:  dice, roll-dice
react-super-styled
Responsive JSX layouts with Styled Components
Stars: ✭ 77 (+28.33%)
Mutual labels:  react-component
roller
Dice roller written in Go and Javascript to run on Google Appengine
Stars: ✭ 26 (-56.67%)
Mutual labels:  dice
react-amap
基于 React 封装的高德地图组件,助你轻松的接入高德地图到 React 项目中。
Stars: ✭ 73 (+21.67%)
Mutual labels:  react-component
redux-autoloader
A higher order component for declarative data loading in React and Redux.
Stars: ✭ 56 (-6.67%)
Mutual labels:  react-component
React-Jupyter-Viewer
A react component to embed .ipyb notebooks in a blog or something
Stars: ✭ 50 (-16.67%)
Mutual labels:  react-component
react-bolivianite-grid
React grid component for virtualized rendering large tabular data.
Stars: ✭ 95 (+58.33%)
Mutual labels:  react-component
whatsapp-clone-react
Build a WhatsApp Clone with React JS and FireBase.
Stars: ✭ 38 (-36.67%)
Mutual labels:  react-component
Figicons
📦 150+ packaged & ready icons, designed in Figma. Ships with support for custom line icons.
Stars: ✭ 20 (-66.67%)
Mutual labels:  react-component
react-treeview-component
A react tree-component where user can customize the the tree according to their need
Stars: ✭ 18 (-70%)
Mutual labels:  react-component
react-tv-navigation
React Navigation for TVs
Stars: ✭ 64 (+6.67%)
Mutual labels:  react-component
react-layer-stack
Layering system for React. Useful for popover/modals/tooltip/dnd application
Stars: ✭ 158 (+163.33%)
Mutual labels:  react-component
react-github-contribution-calendar
A React component for GitHub-like heatmap calendar
Stars: ✭ 100 (+66.67%)
Mutual labels:  react-component
react-ogp
🌐 The ultimate React OpenGraph component
Stars: ✭ 27 (-55%)
Mutual labels:  react-component
urbit
Connects to a running Urbit ship via JavaScript
Stars: ✭ 17 (-71.67%)
Mutual labels:  javscript
react-win32dialog
💠 Modeless, resizeable and moveable dialog boxes with a classic Windows look-and-feel. Comes with a lightweight window manager that supports window stacking.
Stars: ✭ 30 (-50%)
Mutual labels:  react-component
awesome-web-react
🚀 Awesome Web Based React 🚀 Develop online with React!
Stars: ✭ 31 (-48.33%)
Mutual labels:  react-component
Random-Number-Generator
A clean, simple random number generator for Android. Downloaded 180,000+ times and rated 2,000+ times on Google Play with 4.7+ average rating.
Stars: ✭ 30 (-50%)
Mutual labels:  dice
react-octicon
A GitHub Octicons icon React component
Stars: ✭ 76 (+26.67%)
Mutual labels:  react-component
react-ssr-error-boundary
No description or website provided.
Stars: ✭ 33 (-45%)
Mutual labels:  react-component

React Dice

Library for creating multisided dice and rolling them. Check out the demo here.

sample dice roll

Installation

npm install react-dice-complete

Dependencies

Usage (ES6)

import React from 'react'
import ReactDice from 'react-dice-complete'
import 'react-dice-complete/dist/react-dice-complete.css'

class App extends React.Component {

  render() {
    return (
      <div>
        <ReactDice
          numDice={2}
          rollDone={this.rollDoneCallback}
          ref={dice => this.reactDice = dice}
        />
      </div>
    )
  }

  rollAll() {
    this.reactDice.rollAll()
  }

  rollDoneCallback(num) {
    console.log(`You rolled a ${num}`)
  }
}

Available Options

Name Type Default Description
rollDone {String/Function} null callback returns total & individual values from dice roll
numDice {Number} 4 The number of dice you wish to have
defaultRoll {Number} 6 The number you want displayed before a roll
outline {Bool} false Show a 1px outline for each face of the die
outlineColor {String} #000000 hex color code for outline color if outline is true
margin {Number} 15 margin between each die
faceColor {String} #ff00ac hex color code for the face of the die
dotColor {String} #1eff00 hex color code for the dots on the die
dieSize {Number} 60 px width/height of each dice face
rollTime {Number} 2 time in seconds for the roll animation
disableIndividual {Bool} false disable clicks on die to roll each individually

Provided functions

rollAll([values]): rolls all die and calls rollDone with total from roll. You can preset the values you would like the outcome to be by passing array of numbers, if not result will be random.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].