Skip to content
Shiny .NET v4.1 BETA - Linux, MacOS, & Blazor Support! TONS of new features and improvements across the board. Check It Out

CountryPicker

A country search control built on AutoCompleteEntry with flag emoji display, country name, and dial code. Searches all ISO 3166-1 countries with instant local filtering.

  • NuGet downloads for Shiny.Maui.Controls
  • NuGet downloads for Shiny.Blazor.Controls
Frameworks
.NET MAUI
Blazor
EmptyWith Selection
CountryPickerCountry Selected
<shiny:CountryPicker SelectedCountry="{Binding Country}"
Placeholder="Select country..." />

The dropdown shows each country’s flag emoji, name, and dial code. Selecting a country displays the flag next to the input text.

PropertyTypeDefaultDescription
SelectedCountryCountry?nullSelected country (TwoWay)
Placeholderstring"Search countries..."Placeholder text
MaxDropDownHeightdouble200Maximum dropdown height
TextColorColor? / string?nullText color
PlaceholderColorColor? / string?nullPlaceholder color
DropDownBackgroundColorColor? / string?nullDropdown background
DropDownBorderColorColor? / string?nullDropdown border color
SpinnerColorColor? / string?nullLoading spinner color
FontSizedouble14Font size
FontFamilystring?nullFont family (MAUI only)
CornerRadiusdouble4Dropdown corner radius (MAUI only)
EventArgsDescription
CountrySelectedCountryFires when a country is selected

The Country record provides:

PropertyTypeDescription
NamestringCountry name (e.g. “United States”)
Iso2stringISO 3166-1 alpha-2 code (e.g. “US”)
Iso3stringISO 3166-1 alpha-3 code (e.g. “USA”)
DialCodestringInternational dial code (e.g. “+1”)
FlagEmojistringFlag emoji (e.g. ”🇺🇸“)
<shiny:CountryPicker SelectedCountry="{Binding Country}"
FontSize="18"
TextColor="Black"
PlaceholderColor="DarkGray"
DropDownBackgroundColor="#F9FAFB"
DropDownBorderColor="#6B7280"
CornerRadius="12" />
<CountryPicker SelectedCountry="@selectedCountry"
SelectedCountryChanged="OnCountryChanged"
Placeholder="Select country..."
FontSize="16"
TextColor="#333"
InputClass="my-input"
DropDownClass="my-dropdown" />
@code {
Country? selectedCountry;
void OnCountryChanged(Country? country)
{
selectedCountry = country;
}
}
PropertyTypeDefaultDescription
InputClassstring?nullCSS class for the input element
DropDownClassstring?nullCSS class for the dropdown
public partial class MyViewModel : ObservableObject
{
[ObservableProperty] Country? selectedCountry;
partial void OnSelectedCountryChanged(Country? value)
{
if (value is not null)
{
Console.WriteLine($"Selected: {value.Name} ({value.DialCode})");
}
}
}
claude plugin marketplace add shinyorg/skills
claude plugin install shiny-controls@shiny
copilot plugin marketplace add https://github.com/shinyorg/skills
copilot plugin install shiny-controls@shiny
View shiny-controls Plugin