Skip to the content

Hata旗

Load a native country or region flag, choose supported framing and keep each drawing’s source, author and licence.

Hata (旗) is Japanese for a flag. About the name

Contents

Reference · Country and region names

flagEmojifunction

A flag as an emoji: a country's two regional-indicator letters, or the tag sequence for England, Scotland or Wales. A subdivision, a former country, and Northern Ireland have none.

Import it

import { flagEmoji } from "@johnmorrisdotca/hata/names";

Definition

function flagEmoji(code: string): string | null

Parameters

NameTypeDescription
codestring

A flag's code, a name, or another code flagCode reads ("JP", "jpn", "GB-ENG").

Returns

string | null

The emoji, or null when the place has no flag emoji here.

Examples

import { flagEmoji } from "@johnmorrisdotca/hata/names";

console.log(flagEmoji("JP"));      // "🇯🇵"
console.log(flagEmoji("GB-SCT"));  // the Scotland tag sequence
console.log(flagEmoji("JP-13"));   // null
🇯🇵
🏴󠁧󠁢󠁳󠁣󠁴󠁿
null

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/hata 1.31.0.