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 · PH flag SVG

defaultconstant

The flag of Philippines (フィリピン), PH, as an SVG string: viewBox 180 by 90 (2:1), 755 B. From Wikimedia Commons, "Flag of the Philippines.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/ph";

Definition

const svg: string = "<svg data-hata=\"ph\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"#fcd116\" viewBox=\"-28 -45 180 90\"><title>Flag of the Philippines</title><path fill=\"#0038a8\" d=\"M-28-45h180V0L0 44z\"/><path fill=\"#ce1126\" d=\"M0 0h152v45H-28z\"/><path fill=\"#fff\" d=\"m50 0-78 45v-90z\"/><circle r=\"9\"/><g id=\"hata-ph-c\"><g id=\"hata-ph-b\"><path id=\"hata-ph-a\" d=\"m0 0-3.2-16 1-.9zl-1.2-17.8L0-19l1.2 1.2zl2.2-16.9 1 1z\"/><use href=\"#hata-ph-a\" transform=\"scale(-1)\"/></g><use href=\"#hata-ph-b\" transform=\"rotate(90)\"/></g><use href=\"#hata-ph-c\" transform=\"rotate(45)\"/><path id=\"hata-ph-d\" d=\"m41 0-3.4 1.2-.1 3.6-2.2-2.9-3.4 1 2-2.9-2-3 3.4 1.1 2.2-2.9v3.6z\"/><use href=\"#hata-ph-d\" transform=\"rotate(120,-2.019,0)\"/><use href=\"#hata-ph-d\" transform=\"rotate(240,-2.019,0)\"/></svg>"

Examples

Example 1

import flag from "@johnmorrisdotca/hata/flags/ph";

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

What it prints (run when this page was built)

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