On this page
@addTagHelper *, Webority.Ui.RazorBeside a name
The flag sits in the text line with the country name after it, and reads as part of it.
Countries in a list
India
United Kingdom
United States
A standalone flag
Give a label when the flag stands alone, so it is read out as the country name.
Named flag
Every option
Every value of every prop, one cell each.
country
country="IN"country="GB"country="US"label
label="United Kingdom" (names the flag for screen readers, no visible change)className
class="opacity-50" (React: className)Guidance
What to do, and what to avoid.
Use it when
- A country beside its name in a list, a table cell or a profile.
- A country column in a table.
Reach for something else when
- Picking a country. → AppSelect mode="country"
- A phone number with its country. → AppPhoneNumberInput
Reference
Try every prop, read the full list, and check keyboard and screen reader behaviour.
3 props. The 2 most used come first.
Used on most screens 2 props
| Prop | Type | Default | Description |
|---|---|---|---|
| countrydefault - | string | - | ISO 3166-1 alpha-2 code of the country, such as IN. The flag follows the size of the text around it. |
| labeldefault - | string | - | Names the flag for assistive tech. Without it the flag is decorative and hidden, so put the country name in the text beside it. |
Less common 1 props
| Prop | Type | Default | Description |
|---|---|---|---|
| classdefault - | string | - | Extra classes on the flag. |
Screen reader
2 notes- Decorative by default: the country name in the text beside it carries the meaning.
- Give label when the flag stands alone, so assistive tech reads the country.