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

/react

import { … } from "@johnmorrisdotca/hata/react";

4757.9 kB minified and gzipped, with everything it imports (measured with esbuild)

Exports

NameKindWhat it is
BoundFlagtypeA flag ready to draw: its SVG with a style that fills the box, its proportions and the name a screen reader says.
FlagfunctionA flag, drawn inline: a <span role="img"> holding the flag's SVG, with the element's box (its height, proportions, round corners, border and shadow).
FlagPropstypeWhat a binding's flag takes: the same as <hata-flag>'s attributes.
preloadFlagsfunctionLoad flags before a render that cannot wait: a server render to a string, a static build, the first render on the client that must match it.
useFlagfunctionThe flag of a component's props, as a hook: the flag if it is already loaded (preloadFlags), else it is loaded: React 19 suspends until it is, and React 18 draws nothing until an effect has loaded it.

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