CountryInput Blazor API

CountryInput Properties

NameTypeDefaultDescription
DisabledboolfalseEnables or disables the element.
DropDownClassListIEnumerable<object>N/ASets additional class names to the Input drop down.
DropDownButtonPositionDropDownButtonPositionDropDownButtonPosition.NoneDetermines the position of the drop down button.
DropDownHeightobjectSets the height of the drop down. By default it's set to an empty string. In this case the height of the drop down is controlled by a CSS variable.
DropDownWidthobjectSets the width of the drop down. By default it's set to an empty string. In this case the width of the drop down is controlled by a CSS variable.
Namestring""Sets or gets the name attribute for the element. Name is used when submiting data inside an HTML form.
IsOpenedboolfalseDetermines whether the drop down is opened or not.
OnlyCountriesIEnumerable<object>[]Sets or gets an array of country codes which will be used instead of the default one with all countries. The country code should be ISO 3166-1 alpha-2 codes(https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2).
Placeholderstring""Determines the placeholder of the input.
SelectedCountrystring""Sets or gets the selected country of the element. The country code should be ISO 3166-1 alpha-2 codes(https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2).
RightToLeftboolfalseSets or gets the value indicating whether the element is aligned to support locales using right-to-left fonts.
Themestring""Determines the theme for the element. Themes define the look of the elements.
UnfocusableboolfalseIf is set to true, the element cannot be focused.
Valuestring""Sets or gets the value of the element.

CountryInput Methods

NameTypeArgumentsDescription
ClosevoidN/ACloses the drop down.
EnsureVisiblevoidN/AEnsures that the active ( selected ) item is always visible.
GetIsOpenedAsync()Task<bool>'N/A'Gets the &quot;IsOpened&quot; property as Task&lt;bool&gt;.
GetValueAsync()Task<string>'N/A'Gets the &quot;Value&quot; property as Task&lt;string&gt;.
OpenvoidN/AOpens the drop down.
Refreshvoid'N/A'Refreshes the Blazor Component. Performs a layout of the HTML Elements and recalculates the measurements.
Rendervoid'N/A'Re-renders the Blazor Component. This method will make a full re-render.
SelectvoidN/ASelects the text inside the input or if it is <b>readonly</b> then the element is focused.
StateHasChangedvoid'N/A'Refreshes the state and Re-renders the Blazor Component, if necessary.

CountryInput Events

NameTypeDescriptionEvent Detail
OnChangeEventCallback<Event>This event is triggered when the selection is changed.string label- The label of the new selected item., dynamic oldLabel- The label of the item that was previously selected before the event was triggered., dynamic oldValue- The value of the item that was previously selected before the event was triggered., dynamic value- The value of the new selected item.
Changedevent CountryInputChangedEventHandlerThis event is triggered when the selection is changed.CountryInputChangedEventArgs
OnChangingEventCallback<Event>This event is triggered on each key up event of the Input, if the value is changed.dynamic oldValue- The previous value before it was changed., dynamic value- The new value.
Changingevent CountryInputChangingEventHandlerThis event is triggered on each key up event of the Input, if the value is changed.CountryInputChangingEventArgs
OnItemClickEventCallback<Event>This event is triggered when the user clicks on an item from the popup list.dynamic item- The item that was clicked., string label- The label of the item that was clicked., dynamic value- The value of the item that was clicked.
ItemClickedevent CountryInputItemClickedEventHandlerThis event is triggered when the user clicks on an item from the popup list.CountryInputItemClickedEventArgs

Enums

DropDownButtonPosition.None
DropDownButtonPosition.Left
DropDownButtonPosition.Right