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
<PackageReference Include="d20tek-dicenotation-blazor" Version="5.1.9" />
<PackageVersion Include="d20tek-dicenotation-blazor" Version="5.1.9" />
<PackageReference Include="d20tek-dicenotation-blazor" />
paket add d20tek-dicenotation-blazor --version 5.1.9
#r "nuget: d20tek-dicenotation-blazor, 5.1.9"
#:package d20tek-dicenotation-blazor@5.1.9
#addin nuget:?package=d20tek-dicenotation-blazor&version=5.1.9
#tool nuget:?package=d20tek-dicenotation-blazor&version=5.1.9
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
DiceThemepresets (Default,DarkFantasy,Parchment) plus fully custom themes. DiceRollerOptionsfor tray size, theme, visual settings, simulation settings, and reduced motion.ReplayAsyncto 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 | Versions 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. |
-
net10.0
- Aether.Physics2D (>= 2.2.0)
- d20tek-dicenotation (>= 5.1.9)
- Microsoft.AspNetCore.Components.Web (>= 10.0.13)
-
net9.0
- Aether.Physics2D (>= 2.2.0)
- d20tek-dicenotation (>= 5.1.9)
- Microsoft.AspNetCore.Components.Web (>= 9.0.14)
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.