Skip to the content

Kuni国

Look up countries, codes, names and subdivisions, load country data on demand and mount a native country card.

Kuni (国) is Japanese for a country. About the name

Contents

How-to

Use country cards and embeds

Keep typed data choices separate from optional flag/map assets.

Mount a native card

import { KuniCard,defineCard } from "@johnmorrisdotca/kuni/element";
defineCard();
const card=new KuniCard();
card.setAttribute("code","JP");
card.options={colors:{"JP-13":"#2f5d4a"},capital:false};
document.body.append(card);
console.log(card.getAttribute("code"));

The optional element reflects its documented code, language, theme, size and field choices. It composes Kuni data with optional Hata flags and Chizu maps. Core data lookups use no remote service; the card’s default SVG loaders fetch those assets, and hosts can provide flag/map loaders through options. A subdivision’s full code remains distinct from its country code.

Preserve drawing options

Per-place colors and the capital-marker switch are passed to the map loader; capital text fields stay separate. Use the builder to preview each choice and copy native element/module/framework/iframe code. The frame validates setup and uses no storage; it reports native load/error details. The complete embed reference retains all attributes, callback contracts and examples.

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/kuni 1.4.0.