FlagIcon

The FlagIcon component renders a country flag using ISO-3166 country codes. Supports adjustable sizes, rounded borders, and lazy loading.

Basic Usage

Render a country flag by ISO code.

US flagMX flagGB flagFR flagJP flag

Sizes

Control flag size with the size prop.

US flag

sm

US flag

md (default)

US flag

lg

Appearance

Each flag has a subtle border and surface background for consistency with Gatzi’s theme.

CA flagDE flagBR flagKR flagAR flag

Props

Supported properties and default values.

  • code?: string – Two-letter ISO 3166 country code. Default: "us"
  • size?: 'sm' | 'md' | 'lg' – Defines the flag dimensions. Default: "md"
  • className?: string – Extends Tailwind classes for custom styles.
  • ...props – Inherits all native <span> attributes.

Context Example

How to use flags alongside text or other components.

ES flag

Español (México)

US flag

English (US)

FR flag

Français