Skip to content
Sign upGet access
MicrointeractionsSeed diceMenu

Seed dice

A seed you can roll: a 3D die tumbles while each digit spins like a slot drum.

Press the die: it tumbles in 3D while each digit of the seed spins like a slot drum and stops left to right. Lock keeps the seed.

Press the die and it tumbles in three dimensions before landing on a face, while every digit of the seed spins like a slot drum and stops left to right on the new number. The lock keeps the seed: the die greys out and the digits stay put, so the next generation is reproducible.

Installation

$ pnpm dlx shadcn@latest add https://chatcn.dev/r/seed-dice.json

Usage

tsx
import { SeedDice } from "@/components/ui/chatcn/seed-dice"

<SeedDice seed={seed} onSeedChange={setSeed} locked={locked} onLockedChange={setLocked} />

Props

PropTypeNotes
seed / onSeedChangenumber
locked / onLockedChangebooleanShows the lock when set
digitsnumberDefault 6
labelstringDefault "Seed"

Accessibility

  • The seed reads as one number; the roll and lock buttons are labelled.

Motion

  • The die is a CSS 3D cube, 760 ms to a random face after two or three tumbles. Each drum turns at least once, later digits longer.
  • Reduced motion: the face and digits change in place.