NumberInput.Blazor 10.0.0

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

Blazor Custom Input Number Component

This library provides a highly customizable and robust numeric input component for Blazor applications. It is designed to handle real-number entry with advanced localization support, min/max range validation, and real-time formatting.

🚀 Key Features

  • Culture-Aware Formatting:** Seamlessly handles decimal and group separators based on CultureInfo.
  • Real-time Validation:** Uses Regex-based pattern matching to ensure input integrity while the user types.
  • Precise Control:** Configurable step increments, decimal places, and min/max range constraints.
  • Responsive UI:** Built with Bootstrap 5 integration for consistent, professional styling.
  • Event-Driven:** Easy integration with standard Blazor data binding (@bind-NumberValue support).

Screenshot 1

🛠️ Installation and API Reference

To use the component, add a reference to the NumberComponentLibrary project and ensure Bootstrap 5 CSS/JS is loaded in your application.

Usage Example

<NumberInput 
    @bind-NumberValue="myDecimalValue"
    MinValue="0"
    MaxValue="1000"
    DecimalPlaces="2"
    Placeholder="Enter a number..."
    Required="true" />

Component Parameters

The component supports the following configuration parameters:
  • Culture: CultureInfo (default: CultureInfo.CurrentCulture) Used for formatting the number value. If not set, gets CurrentCulture from system settings.

  • NumberValue: decimal? (default: null) Entered or selected decimal value formatted and displayed to the user.

  • Disabled: bool? (default: false) Flag for enabling or disabling the component.

  • Step: decimal? (default: decimal.One) Increase/decrease step value for up/down selection arrows. If set to decimal.Zero → "any".

  • MinValue: decimal? (default: decimal.MinValue) Minimal value that can be entered or selected.

  • MaxValue: decimal? (default: decimal.MaxValue) Maximum value that can be entered or selected.

  • NumberFormat: string? (default: "N") String representation of number format (overrides DecimalPlaces if set after it).

  • DecimalPlaces: int? (default: null) Number of allowed decimal places inside the component. Defaults to Culture settings.

  • TextAllign: string? (default: "text-center") Align text inside the component text box (text-start, text-center, text-end).

  • Required: bool? (default: false) Is Required Value flag for visual validation (applies red/green borders).

  • ShowStandardRequiredMessage: bool? (default: false) Flag for showing standard HTML popup message for required fields.

  • RequiredValueValidationMessage: string? (default: "Value in this field is required.") Custom validation message for the required field.

  • PreventEnter: bool? (default: false) Flag for preventing the acceptance of the Enter key.

  • Placeholder: string? (default: null) Placeholder text displayed when the input is empty.

  • AutoComplete: string? (default: "off") Flag for enabling or disabling autocomplete for the HTML input.

📂 Project Structure

/NumberComponentLibrary: 
    Source code for the NumberInput component, 
    including the Razor markup and its partial C# class logic.

/NumberComponentTestApp: 
    Blazor application for testing and 
    demonstrating the component functionality in real-world scenarios.

📄 License

  • This project is licensed under the CC0-1.0 license (Public Domain).
  • To the extent possible under law, the author(s) have dedicated all copyright and related rights to this software to the public domain worldwide.
  • Feel free to use, modify, and distribute the code without any restrictions.
  • For more details, see the LICENSE file or view the full legal text at Creative Commons CC0 1.0 Universal.

📧 Contact

If you have any questions, encounter issues, or need assistance with the component, 
feel free to reach out via email: periczeljkosmederevo@yahoo.com.
Product Compatible and additional computed target framework versions.
.NET 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
10.0.0 91 9/6/2026
1.0.0 120 5/23/2026

Major upgrade to .NET 10.

BREAKING CHANGE:
- This version targets .NET 10 and drops support for .NET 8.
- Projects consuming this package must update their target framework to .NET 10 before upgrading the package.