BoundFlagtype
A flag ready to draw: its SVG with a style that fills the box, its proportions and the name a screen reader says.
Import it
import type { BoundFlag } from "@johnmorrisdotca/hata/bind";
Also exported from: @johnmorrisdotca/hata/react, @johnmorrisdotca/hata/vue
Definition
interface BoundFlag {
svg: string;
name: string;
aspect: number;
}
Members
| Name | Type | Description |
|---|---|---|
svg | string | The flag's SVG, as the package ships it (framed as asked). |
name | string | What a screen reader says: |
aspect | number | Width over height. |
Examples
import { resolveFlag, type BoundFlag } from "@johnmorrisdotca/hata/bind";
const found: BoundFlag | null = await resolveFlag({ code: "JP" });
console.log(found?.name, found?.aspect); // "Japan" 1.5Japan 1.5What it prints (run when this page was built)