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 · Native flag element

defineFlagfunction

Register <hata-flag>, once. Where there is no browser, or the name is already taken, it does nothing. A page that wants another name passes it.

Import it

import { defineFlag } from "@johnmorrisdotca/hata/element";

Also exported from: @johnmorrisdotca/hata/element/define

Definition

function defineFlag(name?: string): void

Parameters

NameTypeDescription
name (optional)string

The tag to register; hata-flag when left out.

Examples

import { defineFlag } from "@johnmorrisdotca/hata/element";

console.log(defineFlag());               // <hata-flag code="JP"></hata-flag>
console.log(defineFlag("my-flag"));      // <my-flag code="JP"></my-flag> as well
undefined
undefined

What it prints (run when this page was built)

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