Theme Switcher

Flag

Displays a flag as an svg based on the provided country code.

flag for US
flag for JP
flag for ES
import { Flag } from "@ngrok/mantle/flag";

<Flag code="US" />
<Flag code="JP" loading="lazy" />
<Flag code="ES" loading="eager" />

API Reference

The Flag accepts the following props in addition to the standard HTML div attributes.

PropTypeDefaultDescription
code
string

The country code of the flag to render.

size
  • s
  • m
  • l
l

The size of the flag to render. The default size is large.

loading
  • eager
  • lazy
lazy

A string providing a hint to the user agent as to how to best schedule the loading of the image to optimize page performance. See MDN docs.