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';Playground
Props
size
🇯🇵
<Flag aria-label="Japan" size="sm" code="JP" />Examples
Default
States
- 🇯🇵
default - 🇯🇵
size="sm" - 🇯🇵
size="md" - 🇯🇵
size="lg"
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| coderequired | string | — | 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-label | string | — | 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
Web only
Flag has no @nexub/react-native twin. On phones, follow the platform pattern instead, or compose it from the native components listed on the React Native page.