d20tek-dicenotation-blazor 5.1.9

dotnet add package d20tek-dicenotation-blazor --version 5.1.9
                    
NuGet\Install-Package d20tek-dicenotation-blazor -Version 5.1.9
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="d20tek-dicenotation-blazor" Version="5.1.9" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="d20tek-dicenotation-blazor" Version="5.1.9" />
                    
Directory.Packages.props
<PackageReference Include="d20tek-dicenotation-blazor" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add d20tek-dicenotation-blazor --version 5.1.9
                    
#r "nuget: d20tek-dicenotation-blazor, 5.1.9"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package d20tek-dicenotation-blazor@5.1.9
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=d20tek-dicenotation-blazor&version=5.1.9
                    
Install as a Cake Addin
#tool nuget:?package=d20tek-dicenotation-blazor&version=5.1.9
                    
Install as a Cake Tool

d20Tek DiceNotation Visual Dice Roller for Blazor

A Blazor component that animates dice rolls produced by the d20Tek.DiceNotation library. The dice library decides the outcome and the component presents it, so an animation never changes a result.

Install

dotnet add package d20tek-dicenotation-blazor

Register the services

builder.Services.AddDiceNotationBlazor();

This registers the dice library and the component services together, so a single call is enough for most applications.

Use the component

@inject IDice Dice

<VisualDiceRoller Result="_result" OnRollCompleted="OnCompleted" />

<button @onclick="Roll">Roll</button>

@code {
	private DiceResult? _result;

	private void Roll() => _result = Dice.Roll("4d6k3+2");

	private void OnCompleted(DiceRollSummary summary) => Console.WriteLine(summary.Total);
}

Assign a finished DiceResult to Result and the component animates it. When the dice settle, OnRollCompleted reports a DiceRollSummary containing the expression, the total, and the individual die values.

Features

  • Physics-driven dice that tumble and settle in a tray, rendered on an HTML canvas.
  • Shape-aware dice: d2 renders as a round coin, d4 as a triangle, d6 as a square, d8 as a diamond, d10 and d100 as kites, d12 as a pentagon, and d20 as a hexagon.
  • Built-in DiceTheme presets (Default, DarkFantasy, Parchment) plus fully custom themes.
  • DiceRollerOptions for tray size, theme, visual settings, simulation settings, and reduced motion.
  • ReplayAsync to re-animate the current result without rolling again.
  • An accessible label describing the settled result, and a reduced-motion mode.

Supported targets

  • .NET 9 and .NET 10.
  • Blazor WebAssembly and Blazor Server.

Documentation

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
5.1.9 44 10/28/2026

Current release:
     * Initial release of the VisualDiceRoller Blazor component.
     * AddDiceNotationBlazor registers the dice library and the component services together.
     * DiceRollerOptions configures tray size, theme, visual settings, simulation settings, and reduced motion.
     * Built-in DiceTheme presets: Default, DarkFantasy, and Parchment.
     * Shape-aware rendering and physics for d2, d4, d6, d8, d10, d12, d20, and d100.