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 · Flags a page registers itself

customFlagfunction

A registered custom flag's SVG, the checked and rewritten one, with a viewBox and no width or height, like a country's: frame() and toDataUri() from the main entry take it.

Import it

import { customFlag } from "@johnmorrisdotca/hata/custom";

Definition

function customFlag(id: string): string | null

Parameters

NameTypeDescription
idstring

The flag's id, in any case.

Returns

string | null

The SVG string, or null when no such flag is registered.

Examples

import { customFlag } from "@johnmorrisdotca/hata/custom";

console.log(customFlag("custom:nothing-here")); // null
null

What it prints (run when this page was built)

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