Basic
With helper text
Required
A phone number input with an integrated country selector. Formats digits automatically according to the selected country's pattern, validates the number, and auto-detects the country when a full international number is pasted.
Basic phone input with label, helper text, and two-way value binding.
Basic
With helper text
Required
Control which countries appear in the dropdown. A single-country list renders a static prefix with no dropdown.
All countries (default)
Limited countries (MD, RO, US)
Single country — static prefix
When exactly one country is provided, the selector becomes a static non-interactive prefix.
Default country preselected
<!-- Limited countries -->
<FodPhoneInput AllowedCountries="new() { PhoneCountryData.MD, PhoneCountryData.RO, PhoneCountryData.US }"
@bind-Value="_phone" />
<!-- Single country — static prefix, no dropdown -->
<FodPhoneInput AllowedCountries="new() { PhoneCountryData.MD }"
@bind-Value="_phone" />
<!-- Preselect a default country -->
<FodPhoneInput DefaultCountry="PhoneCountryData.RO" @bind-Value="_phone" />Disabled and read-only states prevent user interaction with both the input and the country selector.
Default
Disabled
Read-only
<FodPhoneInput Disabled="true" Value="60123456" />Convey validation state with visual status variants applied to the input.
Default
Success
Warning
Destructive
<FodPhoneInput Status="InputVariant.Success" HelperText="Number verified" />Use ActiveCountryChanged to react when the user selects a different country, and access FullNumber for the complete international number.
ActiveCountryChanged callback
FullNumber (dial code + digits)
<FodPhoneInput @ref="_phoneRef"
ActiveCountryChanged="OnCountryChanged"
@bind-Value="_phone" />
@code {
private FodPhoneInput? _phoneRef;
// Country switched by the user
private void OnCountryChanged(PhoneCountryConfig country)
{
Console.WriteLine($"Switched to {country.DisplayName} {country.DialCode}");
}
// Full international number: dial code + digits
private string FullNumber => _phoneRef?.FullNumber ?? string.Empty;
}Pasting a full international number (e.g. +40723000000) automatically detects and switches to the matching country.
Paste a full international number
Try pasting: +40723123456 (Romania), +16505550100 (US), +4407911123456 (UK)
FodPhoneInput component properties and their descriptions.