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 · US-HI flag SVG

defaultconstant

The flag of Hawaii (ハワイ州), US-HI, as an SVG string: viewBox 48 by 24 (2:1), 711 B. From Wikimedia Commons, "Flag of Hawaii.svg" (public domain); the /manifest entry gives its author, licence and why it was chosen. It has a viewBox and no width or height, so it fills the box it is put in at its own aspect ratio.

Import it

import value from "@johnmorrisdotca/hata/flags/us-hi";

Definition

const svg: string = "<svg data-hata=\"us-hi\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"#012169\" viewBox=\"0 0 48 24\"><clipPath id=\"hata-us-hi-a\"><path d=\"M0 0h24v14H0z\"/></clipPath><clipPath id=\"hata-us-hi-b\"><path d=\"M0 0v6h22v6h-1zm21 0H10.5v13H0v-1z\"/></clipPath><path d=\"M0 0h48v24H0z\"/><path stroke=\"#fff\" stroke-width=\"2.4\" d=\"m0 0 28 16M21 0 0 12\" clip-path=\"url(#hata-us-hi-a)\"/><path stroke=\"#c8102e\" stroke-width=\"1.6\" d=\"m0 0 28 16M21 0 0 12\" clip-path=\"url(#hata-us-hi-b)\"/><path stroke=\"#fff\" stroke-width=\"4\" d=\"M10.5 0v14M0 6h24\"/><path fill=\"#fff\" d=\"M48 0v4H22l-1-1V0zm0 9v4H21V9zm0 9v6H0v-6z\"/><path fill=\"#c8102e\" d=\"M48 3v4.2H0V4.8h21V3zm0 9v3H0v-3zm0 9v3H0v-3zM9.3 0h2.4v13H9.3z\"/><path d=\"M48 6v2.5H21V6z\"/></svg>"

Examples

Example 1

import flag from "@johnmorrisdotca/hata/flags/us-hi";

const host=document.createElement("div");
host.innerHTML = flag; // or toDataUri(flag) from "@johnmorrisdotca/hata" for an <img src>
console.log(host.querySelector("svg")?.getAttribute("viewBox"));

Example 2

import { svg } from "@johnmorrisdotca/hata/flags/us-hi";
console.log(svg.startsWith("<svg"),svg.length);
true 711

What it prints (run when this page was built)

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