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.

Validation & states

Validation inside and outside an EditForm, disabled and read-only fields, the borderless and underlined variants, and placing and sizing the list.

Validation

Inside an EditForm the data annotations validate the bound country and the field gets aria-invalid; NoValidate opts out. Outside a form, Invalid marks the field and ErrorMessage (or ErrorMessageTemplate) also writes the reason under it, referenced by aria-describedby and announced when it appears.

ShowValidationMessage shows the messages of the form under the field, where ErrorMessage goes, so the form below needs no ValidationMessage component. The field is described by them through aria-describedby, so they are read out when it takes the focus, and an ErrorMessage of the app's own wins the place while it is set. They are not announced as they appear: a submit validates every field at once, and a message from each of them read out in a row would bury the form under its own errors. A BitParams holding a BitCountryPickerParams with ShowValidationMessage turns it on for every country picker inside it.

We do not ship there yet.
We ship to the European Union only.
We do not ship there yet.​


Disabled & ReadOnly

Disabled dims the field and takes it out of the tab order. ReadOnly keeps it focusable and its country readable while refusing to open the list; the field drops its caret.

Variants

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.


Callout

DropDirection (TopAndBottom by default, or All) and MaxHeight place and size the list. The arrow keys wrap at its ends unless NoWrapNavigation is set; Home, End, Page Up and Page Down move through it too, and Escape or Alt+Up close it. Responsive turns it into a full-height side panel on small screens, with the Label and a close button (ResponsiveCloseIconName, ResponsiveCloseButtonAriaLabel) - narrow the window to see it.

Feedback

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