Skip to content

Extras

PhoneInput

Bit.BlazorUI.Extras

BitPhoneInput pairs a searchable country selector - flag, name and dialing code - with a tel input. Value always holds the full number in E.164 form (+[code][number]), while the local digits and the country stay bindable on their own through Number and Country. A typed or pasted international prefix picks its country, the digits can be laid out over a per-country pattern, and the whole field is keyboard and screen-reader operable.

Input & value

The clear button, Strict and MaxLength, the full-width, borderless and underlined looks, immediate updates, binding the value, number and country, and formatting the digits as they are typed.

Clear button

ShowClearButton adds a button that empties the number (keeping the country), returns the focus to the input, raises OnClear and tells a screen reader "Cleared" (ClearedAnnouncement rephrases it; an empty string silences it). Its icon comes from ClearButtonIconName, its content from ClearButtonTemplate.


Last cleared at:

Strict & MaxLength

Strict drops every typed or pasted character that cannot be part of a number. MaxLength caps the text in the field, separators included.

Strict (try letters or symbols):

MaxLength="10":

Variants

FullWidth stretches the field to its container, NoBorder removes the frame, and Underlined keeps only a bottom rule that thickens on focus. Background and Border take the fill and the frame from the neutral color kinds, for a field on a surface other than the primary one.



Immediate

The value updates on the change event by default. Immediate updates it on every keystroke, and DebounceTime or ThrottleTime rate-limit those updates.

Immediate:
Value: []

Immediate + DebounceTime (500ms):
Value: []

Immediate + ThrottleTime (500ms):
Value: []

Binding

Value (full E.164 number), Number (local part) and Country are all two-way bindable and stay in step: a full number assigned from outside is split back into its parts. The national prefix a number is written with at home (the 0 of 0170 1234567) is dropped from Value, keeping it valid E.164, unless KeepNationalPrefix is set. The text field below is bound to the same Value.



Value (full number):
Number (local):
Country: Germany

Format as you type

Mask lays the digits over a pattern where every # is a digit slot - (###) ###-#### shows 4155550123 as (415) 555-0123 - while the Value stays plain E.164 and the caret keeps its place. MaskSelector gives each country its own pattern (null leaves it unformatted), and AutoPlaceholder shows that pattern as the placeholder.

Mask:
Value: []

MaskSelector (United States, France, Germany):
Value: []

MaskSelector + AutoPlaceholder:

Feedback

Found a mistake, a gap, or something that could be clearer? Every page and every component is one click from its source.