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

Reference

Register country cards

import { … } from "@johnmorrisdotca/kuni/element/define";

290.3 kB minified and gzipped, with everything it imports (measured with esbuild)

Register the country card. Safe to import without a browser.

Exports

NameKindWhat it is
defineCardfunctionRegister <kuni-card> or a host's own tag, preserving an existing definition.
KUNI_CARD_FIELDSconstantThe fields a card can show, in any order; facts retain their recorded year.
KUNI_CARD_OPTION_KEYSconstantHost option keys, kept complete by TypeScript and checked by the builder.
KuniCardclass<kuni-card code="JP" fields="name flag map capital population">, a country or ISO subdivision without stored state.
KuniCardOptionstypeHost SVG loaders and native map appearance; attributes override drawing defaults.
readCardColorsfunctionRead the card's bounded code:hex-colour attribute without accepting CSS or markup fragments.

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