Skip to content
HomeCobalt

Flag

Shows a country by its flag at the size of the text: beside the country's name, or named on its own beside a code, with a grey box where there is no flag.

Examples

Flags at the size of the text, beside a country's name and named on their own beside a code.
  • Cayman Islands412 funds
  • Luxembourg188 funds
  • Ireland141 funds
  • United Kingdom96 funds

Filed from US and LU.

In a tableA domicile column where the flag leads the name in each row; in a narrow column the flag stands named beside its code.
FundDomicileGross assets
Harbour Street Master Fund LPKY$48.2B
Calder Global Relative Value FundIE$31.7B
Northgate Credit Opportunities SICAVLU$22.4B
Meridian Opportunities Fund IIUS-DE$9.8B

States

Norway
DecorativeBeside the country's name, so a screen reader hears it once.
  • Kosovo
  • Delaware, United States
MissingA code with no flag keeps the grey box, so the column holds its line; a state draws its country's flag.
LU
NamedBeside a code, the flag names the country to a screen reader and on hover.

Usage

Use it when

  • A row, an option or a fact names a country or a place in one: a fund's domicile, an office's country, a country to choose.
  • A column of codes such as KY and LU, where the flag finds a country faster than two letters.

Use something else when

  • The choice is a language, not a country. Use Select instead, with each language named in itself, such as "Español", since one language is spoken in many countries and one country speaks many.
  • The mark names a person. Use Avatar instead.
  • The mark is a category, such as a fund's type. Use Tag instead, which takes its hue from the key.

Rules

General

Content

Avoid

Install

npx shadcn@latest add https://kaanarici.com/r/cobalt/flag.json
import { Flag, countryName } from "@/components/cobalt/ui/flag"