Gathering detailed insights and metrics for react-cool-die
Gathering detailed insights and metrics for react-cool-die
Gathering detailed insights and metrics for react-cool-die
Gathering detailed insights and metrics for react-cool-die
npm install react-cool-die
Typescript
Module System
Node Version
NPM Version
TypeScript (54.36%)
SCSS (34%)
JavaScript (10.65%)
HTML (0.99%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
2 Stars
9 Commits
1 Watchers
1 Branches
1 Contributors
Updated on Mar 07, 2023
Latest Version
1.0.3
Package Id
react-cool-die@1.0.3
Unpacked Size
160.36 kB
Size
134.54 kB
File Count
38
NPM Version
6.14.8
Node Version
14.13.1
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
1
37
A cool die component for rendering a 3D die in React.
The die is built entirely using DOM elements with 3D CSS transformations
The die is written in Typescript, and is fully typed
Visually, the die is very easy to style by just overriding the default styling.
To add to your project
npm install --save react-cool-die
or if you use yarn
yarn add react-cool-die
CSS must then be imported into your project, either as a side effect in Javascript
1import 'react-cool-die/react-cool-die/output/theme.css';
or directly in CSS/SCSS
1@import '~react-cool-die/react-cool-die/output/theme';
To use:
1import * as React from 'react'; 2import { Die } from 'react-cool-die'; 3 4const MyCoolComponent = () => { 5 const [value, setValue] = React.useState(5); 6 const [rolling, setRolling] = React.useState(false); 7 8 return <Die value={value} rolling={rolling} />; 9};
MyCoolComponent
takes three props
value
(number) the current value to show on the dierolling
(boolean) whether to play the random rolling animationspin
(function) trigger a spin - this function is asyncronousTo use with a random roll:
1import * as React from 'react'; 2import { Die, useRandomDieRoll } from 'react-cool-die'; 3 4const MyCoolComponent = () => { 5 const { rolling, value, spin } = useRandomDieRoll(); 6 7 return ( 8 <> 9 <Die value={5} rolling={rolling} /> 10 <button onClick={spin}>spin</button> 11 </> 12 ); 13};
The only arg that useRandomDieRoll
takes is rollTime
which is the time for a roll to happen in milliseconds.
Visually, the die is very easy to style by just overriding the default styling in CSS.
Certain properties will break it, so mostly stick to styling the .die-face
and .point
class
1.die-face { 2 background-color: red; 3} 4.die-point-wrapper .die-point { 5 background-color: blue; 6}
LOOK AT IT GO
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/9 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
license file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
86 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More