Framework-agnostic dice rolling library with highly configurable Vue 3 component
Roll some dice right here in your browser
Core library works with any JavaScript framework or vanilla JS
CSS variables for complete color customization
Core library has no runtime dependencies
<10KB minified + gzipped
Full type safety and IntelliSense support
20+ props to control display and behavior
Flexible rules system for game-specific constraints
Customize any part of the component
Add animations, sounds, and effects via plugins
Use with any JavaScript framework or vanilla JS
npm install @dice-roller/core
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
Ready-to-use Vue 3 component with tons of options
npm install @dice-roller/vue
<template>
<VDiceRoller notation="2d6+3" />
</template>
<script setup>
import { VDiceRoller } from '@dice-roller/vue';
</script>