Language flag
A small flag for a language code, with an optional label.
Installation
pnpm add @heyramzi/uiUsage
import { LanguageFlag } from "@heyramzi/ui/components/language-flag";Keyboard and accessibility
- The flag's alt is the language code in capitals, like "FR".
- With showLabel on, the flag's alt is empty, so the code is read once, from the label.
API reference
languagerequiredstringflagsRecord<string, string>- Default
LANGUAGE_FLAGS - Language code to image URL, for another set or path.
size"sm" | "md"- Default
"sm" showLabelboolean- Default
false classstring
| Prop | Type | Default |
|---|---|---|
language required | string | |
flags Language code to image URL, for another set or path. | Record<string, string> | LANGUAGE_FLAGS |
size | "sm" | "md" | "sm" |
showLabel | boolean | false |
class | string |