Skip to content
h v3.13.3
Search the docs
Find a component, section or page.

Language flag

A small flag for a language code, with an optional label.

EN FR ES
en fr de

Installation

pnpm add @heyramzi/ui

Usage

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

language required string
flags Record<string, string>
Default LANGUAGE_FLAGS
Language code to image URL, for another set or path.
size "sm" | "md"
Default "sm"
showLabel boolean
Default false
class string
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