Flag
A country's flag from its ISO code, sized to the text beside it.
Shipping from Portugal to Japan, Poland and the United States.
- Japan JP
- Poland PL
- France FR
- Germany DE
- Brazil BR
- India IN
- Kenya KE
- Canada CA
- Mexico MX
- New Zealand NZ
- Unknown region ZZ
Installation
pnpm add @heyramzi/uiUsage
import { Flag } from "@heyramzi/ui/components/flag";Keyboard and accessibility
- The flag is hidden from screen readers by default, because the country name sits beside it.
- Shown alone, pass label="Japan" and it becomes an image with that name.
API reference
coderequiredstring | null | undefined- ISO 3166-1 alpha-2 code, or XK for Kosovo, any case. Unknown or empty renders nothing.
labelstring- Names the flag for a reader. Leave it out when the country name sits beside it.
basestring- Default
FLAG_BASE - Where the host serves `<CODE>.svg`.
classstring
| Prop | Type | Default |
|---|---|---|
code required ISO 3166-1 alpha-2 code, or XK for Kosovo, any case. Unknown or empty renders nothing. | string | null | undefined | |
label Names the flag for a reader. Leave it out when the country name sits beside it. | string | |
base Where the host serves `<CODE>.svg`. | string | FLAG_BASE |
class | string |