AppCountrySelect
A searchable country picker: every country with its flag, valued by ISO code.
<app-country-select name="country" label="Country" /><app-country-select> is the country picker: a searchable select holding every country with its flag. It posts the two-letter ISO code (IN), so the value is stable whatever language or spelling the name shows in.
The country list and the flags live once in the shared <wui-country-select> element, so no product keeps its own list and the helper takes no option children. The Razor <app-country-select> and the React <AppCountrySelect> render the same control. Flags are SVG from @webority/theme, not emoji, because Windows has no flag emoji font.
The flags are an opt-in stylesheet, not part of wui-components. A site that renders this picker links _content/Webority.Ui.Razor/css/webority-flags.css after the theme stylesheet, or imports @webority/theme/scss/flags once after wui-components in its own SCSS; without it every flag is an empty grey box.
When to use
Use it when
- A form field asks which country: address, billing, nationality, business registration.
Reach for something else when
- It is a phone number with its country code. → AppPhoneNumberInput
- The list is regions or markets that are not countries. → AppSelect
Playground
Every attribute, live. Each change re-renders the real tag helper on the server, so the markup underneath is the exact call that produced the picker above it.
Basic
Every country, searchable. Type part of a name to jump to it.
Show code
<app-country-select name="home-country" label="Country" value="IN" />
A shortlist
Pass countries to offer only some. They are listed alphabetically by name; a short list rarely needs the search box.
Show code
<app-country-select name="billing-country" label="Billing country"
countries="IN,AE,GB,US,SG" searchable="false" clearable="true"
hint="We invoice in these countries only." />
GB, not United Kingdom. Names change and differ by language; the code does not.Sizes and states
size="sm"defaultsize="lg"emptyerrordisabledAttributes
| Attribute | Type | Default | Description |
|---|---|---|---|
| asp-for | ModelExpression | - | Binds name, id, value, label and required from the model. |
| name | string | - | Form field name; the ISO code posts under it. |
| value | string | - | Selected ISO 3166-1 alpha-2 code, e.g. IN. |
| countries | string | every country | Comma-separated ISO codes that limit the list (React takes an array). Listed alphabetically; unknown codes are ignored. |
| searchable | bool | true | Show the search box in the menu. |
| clearable | bool | false | Adds a control that clears the choice. |
| placeholder | string | Select country | Shown when nothing is chosen. |
| search-placeholder | string | Search countries... | Placeholder of the search box. |
| size | string | md | sm / md / lg, the same scale as <app-input>, so it lines up with text fields. An unknown value throws. |
| label | string | - | Field label; also the accessible name. |
| floating-label | bool | false | Label sits inside and slides up. |
| required | bool | false | Required mark and native required. |
| disabled | bool | false | Disables the control. |
| hint | string | - | Help text under the control. |
| error | string | - | Error text; marks the control invalid. |
| help | string | - | Info-tip content beside the label. |
| help-label | string | More information | Info-tip button label. |
| aria-label | string | - | Explicit accessible name for the control. Wins over the label-derived name, needed for a label-less picker. |
| aria-labelled-by | string | - | Forwarded verbatim onto the control (React aria-labelledby). |
| aria-described-by | string | - | Forwarded verbatim onto the control (React aria-describedby). |
| input-class | string | - | Extra classes on the control (React className). |
| class | string | - | Extra classes on the .field wrapper (React fieldClassName). |