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 · BR-MS flag SVG

svgconstant

The flag of Mato Grosso do Sul (マットグロッソ・ド・スル州), BR-MS, as an SVG string: viewBox 1000 by 700 (10:7), 302 B. From Wikimedia Commons, "Bandeira de Mato Grosso do Sul.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 { svg } from "@johnmorrisdotca/hata/flags/br-ms";

Definition

const svg: string = "<svg data-hata=\"br-ms\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 1000 700\"><path fill=\"#fff\" d=\"M0 0h1000v700H0z\"/><path fill=\"#009ddc\" d=\"M0 700 700 0h300v700z\"/><path fill=\"#00a160\" d=\"M0 0v500L500 0z\"/><path fill=\"#ffe900\" d=\"m850 450 25 77h75l-62 43 25 75-63-47-63 47 25-75-62-43h75z\"/></svg>"

Examples

Example 1

import flag from "@johnmorrisdotca/hata/flags/br-ms";

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/br-ms";
console.log(svg.startsWith("<svg"),svg.length);
true 302

What it prints (run when this page was built)

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