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

CustomFlagInfotype

A registered flag as a list shows it: the id, the names, the group, the width over the height and the source it came from. The drawing is customFlag(id).

Import it

import type { CustomFlagInfo } from "@johnmorrisdotca/hata/custom";

Definition

interface CustomFlagInfo {
    id: string;
    name: {
        en: string;
        ja: string;
    };
    group: string;
    aspect: number;
    source: string;
}

Members

NameTypeDescription
idstring
name{ en: string; ja: string; }
groupstring
aspectnumber
sourcestring

Examples

import type { CustomFlagInfo } from "@johnmorrisdotca/hata/custom";

const label = (flag: CustomFlagInfo): string => `${flag.id}: ${flag.name.en}`;
console.log(label({ id: "custom:a", name: { en: "A", ja: "A" }, group: "custom", aspect: 1.5, source: "mine" }));
custom:a: A

What it prints (run when this page was built)

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