Soenneker.Blazor.Utils.Ids 11.0.64

Prefix Reserved
dotnet add package Soenneker.Blazor.Utils.Ids --version 11.0.64
                    
NuGet\Install-Package Soenneker.Blazor.Utils.Ids -Version 11.0.64
                    
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="Soenneker.Blazor.Utils.Ids" Version="11.0.64" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Blazor.Utils.Ids" Version="11.0.64" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.Blazor.Utils.Ids" />
                    
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 Soenneker.Blazor.Utils.Ids --version 11.0.64
                    
#r "nuget: Soenneker.Blazor.Utils.Ids, 11.0.64"
                    
#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 Soenneker.Blazor.Utils.Ids@11.0.64
                    
#: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=Soenneker.Blazor.Utils.Ids&version=11.0.64
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Blazor.Utils.Ids&version=11.0.64
                    
Install as a Cake Tool

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

Soenneker.Blazor.Utils.Ids

A thread-safe, allocation-conscious generator for related DOM IDs in Blazor components.

It produces readable process-unique IDs such as email-42 and derived IDs such as email-42-label, making it useful for id, for, aria-labelledby, and aria-describedby relationships.

Installation

dotnet add package Soenneker.Blazor.Utils.Ids

No service registration is required.

Generate once per component instance

Store the generated ID in a field so it remains stable across renders:

@using Soenneker.Blazor.Utils.Ids

<label id="@_labelId" for="@_inputId">Email</label>
<input id="@_inputId" aria-labelledby="@_labelId" />

@code {
    private string _inputId = null!;
    private string _labelId = null!;

    protected override void OnInitialized()
    {
        _inputId = BlazorIdGenerator.New("email");
        _labelId = BlazorIdGenerator.Child(_inputId, "label");
    }
}

Do not call New directly in Razor markup, a computed property, or BuildRenderTree; each call consumes a new number and would change the element ID on subsequent renders.

string rootId = BlazorIdGenerator.New("dialog");
string titleId = BlazorIdGenerator.Child(rootId, "title");
string contentId = BlazorIdGenerator.Child(rootId, "content");

Child only concatenates the parent and suffix. It does not reserve or independently guarantee uniqueness, so use distinct suffixes beneath a unique parent.

Prefixes, parent IDs, and suffixes must be non-empty and cannot contain whitespace. Other characters are preserved. If an ID is later embedded in a CSS selector, escape it with CSS.escape rather than assuming every valid DOM ID is a valid unescaped CSS identifier.

Uniqueness and rendering boundaries

New uses one atomic, monotonically increasing counter for the process. Values are unique among calls in that process, but they are not stable across application restarts and are not coordinated across multiple server processes or browser tabs.

Server prerendering and client-side rendering run in different processes. Do not expect a newly generated client ID to reproduce the server value. When continuity across that boundary matters, persist the value with Blazor state transfer or derive it from stable application data.

The numeric suffix is predictable. These IDs are for UI identity, not secrets, authorization checks, CSRF protection, public resource identifiers, or security tokens.

Product Compatible and additional computed target framework versions.
.NET net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on Soenneker.Blazor.Utils.Ids:

Package Downloads
Soenneker.Blazor.Utils.JsVariable

A Blazor interop library that checks (and waits) for the existence of a JS variable

Soenneker.Blazor.MediaQuery

A Blazor interop library for media queries for viewport size logic

Soenneker.Blazor.WebWorkers

Web Worker orchestration in Blazor.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
11.0.64 3,253 11/11/2026
11.0.63 566 11/11/2026
11.0.62 1,158 11/11/2026
11.0.61 556 11/10/2026
11.0.60 97 11/10/2026
11.0.59 15,339 10/26/2026
11.0.58 300 10/26/2026
11.0.57 685 10/26/2026
4.0.56 9,009 10/15/2026
4.0.55 98 10/15/2026
4.0.54 104 10/15/2026
4.0.53 251 10/14/2026
4.0.49 1,985 10/14/2026
4.0.48 101 10/14/2026
4.0.42 742 10/13/2026
4.0.41 271 10/12/2026
4.0.39 1,534 10/12/2026
4.0.38 1,659 10/12/2026
4.0.37 1,092 10/11/2026
4.0.36 432 10/11/2026
Loading failed

Updated Multiple NuGet packages