Skip to content

Extras

CountryPicker

Bit.BlazorUI.ExtrasCountrySelectorCountrySelect

BitCountryPicker picks a country out of a searchable list that shows the flag and the name of each one - for the billing country, the nationality or the country of residence a form asks for. Value is the selected BitCountry; the list can be replaced, trimmed and reordered, searched by name or ISO code, and the whole field is keyboard and screen-reader operable.

List & search

Replacing and trimming the list, preferred countries, the search box, the flags, and templates for the field and the rows.

Custom countries

Countries replaces the built-in list (BitCountries.All) and ExcludeCountries trims it.

Preferred countries

PreferredCountries pins countries to the top of the list, set apart from the rest by a rule.

Search box

The search matches names (accents folded, word starts, so united s finds the United States) and ISO codes (de, deu), and the result count is announced to screen readers. Typing on the closed field opens it with the search already started. SearchBoxPlaceholder, SearchBoxAriaLabel and NoResultsText set its texts. NoSearchBox removes it; the field then answers to type-ahead, open or closed. The same letter typed again cycles through the countries starting with it, and what is typed is matched by the rules of the current culture: case is ignored, and so are the accents that culture treats as marks on a letter ("a" finds Åland Islands in English, but not in Swedish, where å is a letter of its own).

Flags

NoFlags leaves the flags out of the field and the list, and FlagUrlSelector serves them from your own source (returning null keeps the built-in one).

Templates

ValueTemplate renders the content of the field from the selected country, ItemTemplate each row, and NoResultsTemplate the empty result.

Feedback

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