Dice

A real six-sided die. Click it and it tumbles, jumps and lands on a random face. Opposite faces add to seven.

Install it the shadcn way: copy the source file into your project. It uses CSS 3D, Tailwind CSS v4 and Framer Motion, no WebGL.

Dice3D props

PropTypeDefaultDescription
sizenumber96Edge length in px.
onRoll(value: number) => voidCalled with the rolled number once the die has landed.
initialnumber1Starting face, 1 to 6.
classNamestringExtra classes added to the outer element.

More components

Guides

Start

Cards

Scenes

Controls & text

Buttons

More cards

UI elements

Form controls

App components

Text & backgrounds

Showpieces

Blocks