PhoneNumberInput.Blazor 1.0.0

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

Blazor Custom Input Phone Number Component

This library provides a reusable Blazor component for phone number input. The component integrates logic for continent and country selection, automatic filtering of the country list, and visual validation, making data entry simpler and more intuitive for end users.

🚀 Key Features

  • Dynamic Filtering: Automatically updates the list of available countries based on the selected continent.
  • Two-Way Data Binding: Full support for @bind syntax for phone numbers, countries, and continents.
  • Customizable Validation: Visual feedback through styled input borders based on the required status.
  • Modularity: Option to include or exclude dropdown menus via component parameters.
  • Modern UI: Built on the Bootstrap 5 framework for a responsive and consistent look.

🛠️ Installation and API Reference

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

Usage Example

<PhoneNumberInput 
    @bind-PhoneNumber="userPhone" 
    @bind-SelectedCountry="userCountry"
    IncludeContinentSelect="true"
    IsRequired="true" />

Screenshot 1 Screenshot 2

Component Parameters

The component supports the following configuration parameters:

  • IncludeContinentSelect (bool, default: true): Shows or hides the continent dropdown.
  • IncludeCountrySelect (bool, default: true): Shows or hides the country dropdown.
  • IsRequired (bool?, default: false): Enables visual validation by applying red/green borders based on input state.
  • Placeholder (string, default: "Enter phone number"): Custom text displayed when the input is empty.
  • AutoComplete (string, default: "off"): Sets the standard HTML autocomplete attribute.

📂 Project Structure

  • /PhoneNumberComponentLibrary: Source code for the component, models, and Enum extensions.
  • /PhoneNumberComponentTestApp: Blazor application for testing and demonstrating the component functionality.

📄 License

This project is licensed under the CC0-1.0 license (Public Domain). Feel free to use, modify, and distribute the code without any restrictions.

📧 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 net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  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 was computed.  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
1.0.0 79 5/22/2026

Initial release of the Blazor Phone Number Input component with continent and country filtering features.