Skip to content
nexubDesign System
v11.9.0

Components · Labels & Badges

Flag

StableAdded v0.0.1

A country flag from its ISO code, drawn with the system emoji font.

import { Flag } from '@nexub/react';
View as Markdown

Playground

Props

size
🇯🇵
TSX
<Flag aria-label="Japan" size="sm" code="JP" />

Examples

Default

🇯🇵🇮🇳🇫🇷

States

  • 🇯🇵
    default
  • 🇯🇵
    size="sm"
  • 🇯🇵
    size="md"
  • 🇯🇵
    size="lg"

Props

Props
PropTypeDefaultDescription
coderequiredstring—ISO 3166-1 alpha-2 country code, e.g. JP. Also the accessible name unless you pass aria-label.
size'sm' | 'md' | 'lg''md'Font size of the flag.
aria-labelstring—A readable name, e.g. "Japan". Defaults to the code.

Accessibility

ARIA roles

img

Notes

  • Windows has no flag emoji and shows the two letters instead. Pair the flag with the country name where it matters.

On iOS & Android