Components · Labels & Badges
Country Badge
StableAdded v0.0.1
A pill with a country flag and its name or code.
import { CountryBadge } from '@nexub/react';Playground
Props
size
🇸🇬Singapore
<CountryBadge code="SG" label="Singapore" />Examples
Default
Sizes
States
- 🇸🇬Singapore
default - 🇸🇬Singapore
size="sm" - 🇸🇬Singapore
size="md" - 🇸🇬Singapore
size="lg"
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| coderequired | string | — | ISO 3166-1 alpha-2 country code, e.g. SG. |
| label | string | — | Text after the flag. Defaults to code. |
| size | 'sm' | 'md' | 'lg' | 'md' | Size of the pill and flag. |
On iOS & Android
Web only
Country Badge 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.