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.1X1 flag SVG

defaultconstant

The flag of United States (アメリカ合衆国), US, drawn again by hand at 1:1 by flag-icons 7.5.0 (MIT), as an SVG string: viewBox 512 by 512, 624 B. The drawing flag("US", { shape: "1:1" }) uses (and the round frame, in a circle), made for that shape by hand rather than cut from the flag. The /manifest entry's framings say how each frame was chosen.

Import it

import value from "@johnmorrisdotca/hata/flags/us.1x1";

Definition

const svg: string = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\"><path fill=\"#bd3d44\" d=\"M0 0h512v512H0\"/><path stroke=\"#fff\" stroke-width=\"40\" d=\"M0 58h512M0 137h512M0 216h512M0 295h512M0 374h512M0 453h512\"/><path fill=\"#192f5d\" d=\"M0 0h390v275H0z\"/><marker id=\"hata-us-1x1-a\" markerHeight=\"30\" markerWidth=\"30\"><path fill=\"#fff\" d=\"m15 0 9.3 28.6L0 11h30L5.7 28.6\"/></marker><path fill=\"none\" marker-mid=\"url(#hata-us-1x1-a)\" d=\"m0 0 18 11h65 65 65 65 66L51 39h65 65 65 65L18 66h65 65 65 65 66L51 94h65 65 65 65L18 121h65 65 65 65 66L51 149h65 65 65 65L18 177h65 65 65 65 66L51 205h65 65 65 65L18 232h65 65 65 65 66z\"/></svg>"

Examples

Example 1

import square from "@johnmorrisdotca/hata/flags/us.1x1";

const host=document.createElement("div");
host.innerHTML = square;
console.log(host.querySelector("svg")?.getAttribute("viewBox"));

Example 2

import { svg } from "@johnmorrisdotca/hata/flags/us.1x1";
console.log(svg.startsWith("<svg"),svg.length);
true 624

What it prints (run when this page was built)

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