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-PB flag SVG

svgconstant

The flag of Paraíba (パライバ州), BR-PB, as an SVG string: viewBox 6000 by 4200 (10:7), 860 B. From Wikimedia Commons, "Bandeira da Paraíba.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-pb";

Definition

const svg: string = "<svg data-hata=\"br-pb\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 6000 4200\"><title>Bandeira da Paraíba&quot;</title><rect width=\"100%\" height=\"100%\"/><rect width=\"4000\" height=\"100%\" x=\"2000\" fill=\"#f00000\"/><path fill=\"#fff\" d=\"M3250 2290v-379h78l156 253v-253h66v379h-72l-156-247v247zm384 0v-379h282v64h-204v84h186v64h-186v103h210v64zm528-140v-63h168v151a268 268 0 0 1-162 58q-63 0-108-25-37-24-66-71-18-47-18-101-1-58 24-105 27-46 72-71 36-18 90-18 72 0 108 29 45 30 54 82l-78 14c-6-18-12-33-30-44q-18-16-54-16-52 0-78 31c-24 22-30 53-30 95 0 45 6 79 30 101q26 34 78 34c18 0 30-3 48-9q26-11 42-23v-49zm222-47q0-58 18-97 9-29 36-53 20-22 48-33 35-15 78-15c60 0 102 17 138 51q47 52 48 145-1 92-48 143-52 52-132 52c-60 0-102-17-138-52q-46-51-48-141m78-3q2 64 30 98 27 33 72 33 53 0 78-33 29-33 30-99-1-66-30-97-25-32-78-32-45-1-72 33-28 32-30 97\"/></svg>"

Examples

Example 1

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

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

What it prints (run when this page was built)

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