🎲 Dice Roller

Framework-agnostic dice rolling library with highly configurable Vue 3 component

Try It Out

Roll some dice right here in your browser

Features

Framework-Agnostic

Core library works with any JavaScript framework or vanilla JS

🎨

Fully Themeable

CSS variables for complete color customization

📦

Zero Dependencies

Core library has no runtime dependencies

Lightweight

<10KB minified + gzipped

🎯

TypeScript

Full type safety and IntelliSense support

🔧

Configurable

20+ props to control display and behavior

🛡️

Validation Rules

Flexible rules system for game-specific constraints

🎰

15 Named Slots

Customize any part of the component

🔌

Plugin System

Add animations, sounds, and effects via plugins

Installation

Core Library (Framework-Agnostic)

Use with any JavaScript framework or vanilla JS

npm install @dice-roller/core

Usage:

import { roll, rollDetailed } from '@dice-roller/core';

// Simple roll
const result = roll("2d6+3");
console.log(result.total); // 5-15

// Detailed roll
const detailed = rollDetailed("3d6+3");
console.log(detailed.rolls);    // [4, 6, 2]
console.log(detailed.modifier); // 3
console.log(detailed.total);    // 15

Vue Component

Ready-to-use Vue 3 component with tons of options

npm install @dice-roller/vue

Usage:

<template>
  <VDiceRoller notation="2d6+3" />
</template>

<script setup>
import { VDiceRoller } from '@dice-roller/vue';
</script>